Server optimization for long running script [duplicate]

I'm eager to say that your script is FAR from optimised by looking at the performance you get the and the server specs you gave. Even your typical smartphone should get much better results than the ones you tell us.

  • Is that "another unknown server" responding fast?
  • Does your script spawn only one request at a time, wait for the results, and only then perform the next request, or does it spawn multiple requests in parallel?
  • Is the database the bottleneck? Does it lack indexes? Does it have some big databases but running with the default settings? From your text it doesn't sound like it, but just making sure.

From the OS point of view, I guarantee you that the default CentOS is good enough for much better performance than the ones you gave us and disabling couple of background processes might give you something like 0.5-1.0% performance boost, if that, and no way 500% like you need. The default CentOS install is not starting with the handbrake on.