4

I've heard that shared hosting often imposes a limit on files per directory, though obviously this would be different per host.

Generally speaking, is number of files still an issue on modern hosts? I am creating a static-page generator meant to be distributed -- yet if someone has a 500k pages (files, even if small) and this passes some arbitrary shared-hosting file limit, then a dynamic solution would be preferred.

At our current time, do many shared hosts impose file limits?

  • Older web hosting accounts did indeed pose file limits as can bee seen here, where now most (like those who use cPanel) place limits on accounts by other means (e.g., disk size, RAM, CPU, bandwidth...). See that link for the recommended files/inodes for cPanel. – dan Feb 26 '16 at 7:15
  • Thank you - a general answer was not clear by searching, so I came here as a last resort. I had seen that link you shared as well. Generally instead of using overhead in the form of queries and dynamic code, I am attempting to pre-generate all pages on a user client which uploads generated pages. – Pipsqweek Feb 26 '16 at 7:24
  • It used to be more of a concern, but now most hosts provide tiered hosting packages based on the above criteria, and typically use either cPanel or Plesk for shared hosting, unless they're using an in-house control panel, which might impose a file limit. It's probably best to contact a few common providers and ask, and then recommend using those if you're not doing the hosting for clients. – dan Feb 26 '16 at 7:35
  • 2
    Underlying file systems may not support that many files per directory. I've run into performance problems at around 30,000 files per directory on Linux. – Stephen Ostermiller Feb 26 '16 at 13:32
  • 1
    To ensure performance is not impaired and filesystems limits are not reached you could always organise the files into subfolders, using either a published date for the folder name or an author user ID, or a thousands prefix for example if page no 30007 you could store it as 30/007.html or similar. If particularly complex you could use a file or database to map requests to the file locations. I've known similar setups where the tool uploading static files also automatically creates an .htaccess file for the root folder which tells apache where to find all the right files for the various pages. – richhallstoke Mar 2 '16 at 12:19
1

It depends on the filesystem and hardware capabilities.

As Wikipedia states for EXT4:

Max. number of files 4 billion (specified at filesystem creation time)

Max. filename length 255 bytes

Filename length and levels of directories are also a performance topic in this relation - below comment applies for them too.

To answer your question: Yes, its still an topic and depending on the hosting companies capabilities and goodwill there is very likely a limit.

Its best practice for a hosting company to outline such limitations either on the hosting plan or in the Fair Use Policy / FAQ's.

0

I've seen the number of files per directory be an issue for operating systems. It doesn't crash, but causes things to run slow when accessing files in that directory. I've had to rewrite web applications to create multiple directories when saving many files to avoid this problem because of performance issues. And that was when we owned the server.

  • What is your answer to user's question ? It seems more like describing your personal experience which is irrelevant to the question; "At our current time, do many shared hosts impose file limits?" – Vasikos Mar 10 '16 at 20:51
0

Do many shared hosting impose a quote? short answer, yes most of them do. Even when stated unlimited, locks/quotas are in place to keep balanced a server and/or keep unfair use at a line.

Although this are often "reasonable". Hostgator, for instance, has a 250,000 inode limit, plenty to start. By the time you reach the quota, you are very likely too big for a shared account and will probably be using a dedicated server, which from the same vendor have a 1' 000,000 inode quota.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.