Say that I have a PHP site running on that hosts larger images. Each page is very simple and takes virtually no time to process in PHP, but it might contain couple MB large image.
The question is, if I have Apache set up to handle 100 connections, and the page itself takes couple ms to generate, does it keep the connection blocked for the image transfer, or is this handled on some other connection pool?
Because in the first case, it might take couple seconds to download the image, so I would be able to serve only 100 clients at a time.
Every connection to the server whether PHP or static file serving are from the same 100 connection pool. Once PHP serves up the HTML the connection is free to be used for something else. If it's a persistent connection then it will probably be re-used to download an image.
Keep in mind that modern browsers will create at least 2 to 6 persistent connections so it'll be less than 100 clients at a time.
Example scenario assuming
KeepAlive
is on: One connection handles the PHP script then that same connection will start downloading an image and the browser opens or uses existing connections to download the other images.It depends on the keepalive setting. If you set it to 'on' connections are reused. If you set it to 'off' new connections are made for every page element (html/php,image,javascript files, css etc). Keeping it on means a better experience for your users at the expense of server CPU load. Keeping it off means a slower browsing experience but server load is slightly reduced. Also you can tune the keepalivetimeout setting. Set it to 5 or less.