Checking server load with PHP and taking appropriate action
- by teehoo
Hi, I'm creating a project in which a server receives operations from clients to apply to a local server document. The server and client both share the same document and therefore each message the client sends contains an MD5 hash, which the server compares to after generating its own hash to ensure the server and client documents are synchronized.
My question is, if the server is overloaded, could I somehow detect this in PHP, which would in turn let me decide whether I want to execute the hash generation function or not?
Perhaps in the scenario defined, this is not a perfect use-case, but I'm interested in this approach in general.