I intend to allow users to upload images to my website, but I'm concerned that Drupal's default handling of files might not be cut out for storing and serving potentially thousands of files without bogging down. Should all files be stored in the same directory? Should I use something like amazon instead of the same server the website is stored on?

What are the best practices for serving images, potentially thousands or tens of thousands, through a Drupal 7 site? Is it reasonable to expect Drupal to perform well if I just leave it the file handling as is?

closed as primarily opinion-based by leymannx, kiamlaluno Jun 20 at 5:56

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Are these files stored in the public or private file system? – Clive Jun 19 at 17:03
  • 1
    It's really up to you to try things out. Maybe the Devel submodule Devel Generate can help you to create dummy content and then do benchmarking in all possible setups. – leymannx Jun 19 at 17:16
  • They are stored in the public file system. – otherpoint Jun 19 at 18:01

If you are storing them the public file system, Drupal does not really interact with them other than to provide the URL. The .htaccess rules check if the request is for a real file. If it is a real file, the web server service it up.

So for individual files, it is more about can your webserver handle the load. You probably want to look at using a static file caching service in front of your site. CloudFlare does a good job and its basically free. Some alternates are to have a varnish server or a caching Nginx server in front of your server.

Drupal has been used for a lot of sites with a lot of users, files and the like. E.g. I know that Story Corps uses it internally to manage the thousands (millions) of interviews they have.

Just be aware that if you need to have a large volume site, you will need to plan for a large volume system setup. This is true of ANY web software you use.

  • Image styles are also worth considering separately, as they require a hit on PHP first time round – Clive Jun 20 at 9:12
  • Ok, thank you all for your insight! – otherpoint Jun 20 at 15:10

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