Apache occasionally fails to load external images, are these tweaks optimum?

Hi everyone,

My website has the occasional (say 1-2 in 10 times a page is loaded) problem in that external images (banners basically) sometimes don’t get loaded and hence an ugly image placeholder is displayed instead.

I’ve managed to fix the problem with the below code but only if a user clicks through the website’s pages within a maximum of 20 seconds or so.

I believe Apache’s configuration is to blame. Could it be KeepAlive? Are the below tweaks okay? Would you add anything into the mix of tweaks?

It’s definitely not the hosted banners themselves, their CDN’s seem to be speedy. The problem also never happens with my own images, just those which are external to the site.

<IfModule prefork.c>
StartServers 10
MinSpareServers 5
MaxSpareServers 10
ServerLimit 150
MaxClients 150
MaxRequestsPerChild 10000

<IfModule worker.c>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0

Many thanks,


While I’m NOT a SysAdmin, I believe you’re on the right track assuming that it’s an Apache configuration problem. I’m not sure which of your <IfModule> configurations to prefer but I think I’d pick ONE and use it. If BOTH of them are enabled, then you’re building a conflict into your configuration specification.

Two other comments: I have to believe that the ZERO for MaxRequestsPerChild means UNLIMITED otherwise, that IS your problem.

I’ve just uploaded a number of client images to my server after building the display pages. I was SHOCKED that several images were not displaying - until I saw that they had a file extension of .JPG instead of the .jpg that they were supposed to be. Problem quickly resolved but consider that, too.



Thanks for your comments. Seems the best solution is to experiment and see where that leads me. Will have to wait till night hours so not to affect a live site.

From what I understand Apache has two types of MPM, one is for smaller sites that require stability (prefork), the other for larger sizes that prefer speed (worker).

If you are having random problems trying to work out why files are ‘missing’, it may be worth installing Firebug into Firefox and enabling the Network Tracking page - this will allow you to see all files requested and any that error - maybe from this you will get a better idea of what is causing the problems.