How Apache, PHP, and soap work together
I have just released PHP, I recently use PHP's own soap to implement the server RPC function.
Looking at a lot of server.php examples, these examples work, but I still have questions.
The code for general server.php is this:
1. Create a class with several member functions.
2. Call function SoapServer () to create a service.
3. Register the functions in the class.
4. Call the handle () function to process the client's RPC call request.
5. After the handle () function returns, this service is considered to be the end.
The Apache server is easy to handle if only one PC initiates client requests. But if there are thousands of client requests,
According to the above process, it is not to create N-times service routines, destroy N routines, the inefficiency imaginable.
Maybe PHP doesn't work this way, so how does Apache and PHP handle SOAP requests when they receive N (a lot of) service requests?
Just a little bit about the process.
------Solution--------------------
is to create n-times service routines and destroy N routines
But
Low efficiency imaginableThis is a very arbitrary conclusion.
The Web service uses a stateless HTTP protocol that, since it is stateless, does not require persistent objects on the server side
Besides, SoapServer () creating a service in a service is just a name, not a service in the real sense.
------Solution--------------------
Reference:
is to create n-times service routines, destroying N-Times routines
But,
inefficient, this conclusion is too arbitrary.
The Web service uses a stateless HTTP protocol that, since it is stateless, does not require persistent objects on the server side
Besides, SoapServer () creating a service in a service is just a name, not a service in the real sense.
Not quite agree with part of the point.
Whether to put a persistent object on the service side is not related to the HTTP protocol stateless, after all, the server resources are limited, the repeated "connect-disconnect", "query-release" will cause unnecessary overhead, there is a persistent object to maintain the data, It's wonderful not to ask for external resources again and again.
By the way moderator help feedback: Improve the text editing experience of the forum, the present is neither "WYSIWYG" is not "mainstream general" such as Markdown,wiki, really difficult to get started, accidentally changed the wrong after the submission and did not correct the opportunity.