I run a very dynamic game review site. All the images (screenshots, game thumbnails, user profile pics, etc.) are served via a PHP script on the server. It takes the id as a parameter and reads the data from the database, outputting it with a content header of image/[png/jpg]. In the very near future (less than a month), we are partnering up with another company. We anticipate traffic to the site to increase dramatically.
My estimate is that our traffic will increase to around 50k per day.
In the past, I have met with this error from our hosting server: you have reached the limit of scripts/processes run per second. I looked it up and found we have a limit of 20 simultaneous scripts (php, cgi, etc.) per second at any given time. On average, each page on our site has 50 images.
My first question is: is this a reasonable limit? Should I expect this sort of limits from other hosting solutions?
Second question:
Is this setup recommended for serving images? I can try to get a server which doesn't have this restriction, but I'm concerned if this setup scalable if we get even more traffic?
The alternatives I can think of are:
- Store the image as a file on the server. The database will store the relative path to the image instead of the image ID. This way, at least the each image won't be a dynamic script that the server needs to run.
- Run multiple image database servers that only serve images. How will the load balancing work then?
Any help would be appreciated.