Apache performance affected by number of files and folders?

Posted on 2007-07-24
Last Modified: 2011-10-03
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.
Question by:mtnr
    LVL 14

    Accepted 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.

    Author Comment

    thanks ygoutham, can you tell me what the OS-based caps are? or where I can find that information?  thank you.
    LVL 14

    Expert Comment

    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

    PRTG Network Monitor: Intuitive Network Monitoring

    Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

    Join & Write a Comment

    In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting ( to http…
    If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now