• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 167
  • Last Modified:

Apache performance affected by number of files and folders?

1. Say there are hundreds or even thousands of files (static html pages) in document root (www).

Does this affect Apache performance?

2. Say Apache has to go 6 folders deep to serve pages. For example:

(And in each folder are many other folders.)

Does this affect Apache performance?

This would be latest 1.x Apache, running on linux.

Thank you.
  • 2
1 Solution
apache latest is 2.0

hundreds and thousands of files is not a problem at all.  as long as the system has a decent ram and processor. apache by itself should not see any performance related issues.

however, there are some caps based on the OS flavor as to maximum number of files in "a" single sub-directory. if you have exceeded that then it is a OS related issue and not apache's problem.
mtnrAuthor Commented:
thanks ygoutham, can you tell me what the OS-based caps are? or where I can find that information?  thank you.
in redhat 8 and subsequent releases the number of files in a SINGLE directory has a cap of around 64000 (i am only guessing here) but the number is definitely 64K if not higher.  any variants that came subsequently also has a similar number.

I think we are not talking about such large number of files within one single directory here!!!  therefore, the assumption is if any of your script were to be running a check on number of files etc from a directory, then we might have a limitation on one instance hogging memory.  

for instance, php.ini restricts any script from taking more than 8MB of execution time memory. similarly the other ini files or httpd.conf can also restrict the amount of RAM used up by one single script.

ideal way of telling as to what is going wrong would be to run "top" command during such sluggish behavior by the server to see which process takes most of the memory/cpu.  see if any job scheduled on CRONTAB is clashing with such timings and so on and so forth.

the possibilities of odd behavior can be due to any number of reasons than number of files in a directory.

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now