No announcement yet.

Attachments in dB or file system, is there really a performance difference?

  • Filter
  • Time
  • Show
Clear All
new posts
    Senior Member

  • janaf
    I just made some measurements
    • Apache Jmeter application
    • Over the internet, not local network
    • On a live server with typically 500 visitors 5000 page views per day
    • Around 500 files in the file attachment area
    • Five pages with an average size of 50K content
      • The forum home
      • The CMS home
      • The Blog home
      • One page with 10 images
      • One section page with 20 article abstracts, each with an image. The slowest page
    • Two test cases
      • Tree users doing a total of 2-3 requests per second, total 500 page loads
      • Ten usesr doing a total of 6-7 request per secons, totally 500 page loads
    • Two storage models
      • File system storage
      • mySQL storage
    • The tests where redone a couple of times, with a few hundred page downloads between each test
    • Average response time 800mS with 2-3 requests per second
    • Average response time 1700mS with 6-7 requests per second
    • Hardly measurable performance difference between storage types (1% better with files on file system) for both loads
    • Much bigger difference between each download and load level than between storage types
    More tests
    • More tests where done ona a single page with 10 images only and the counclusion is the same; no measurable difference in performance between storage types.
    • Other tests done with requesting the full download every time, no cashing. Result; much slower download but hardly measurable dfference between storage models, with about 3% download time advantage for the file system storage type over dB storage.
    Senior Member
    Last edited by janaf; Sat 5 Jun '10, 1:47pm.

    Leave a comment:

  • janaf
    Senior Member

  • Attachments in dB or file system, is there really a performance difference?

    Im curious if someone with a large site and lots of attachments has actually tried if there is really a performance difference in storing attachments and images in the file system or in the database?

    I guess it all comes down to which storage, search and cashing is most efficient. I saw some MS SQL and IIS performace measurements where the result was that the difference was marginal. The SQL solution actually had a small performance benefit with average file sizes under 50K while the file system solution was slightly faster for larger files.

    A decade or more ago, the storage of binary database was very inefficient but this has changed. So I wonder if there still is a performance advantage with file system storage or if this is based on old knowledge. From an organisational and backup point of view I really prefer the database storage model. My own database is so far too small to really see any difference.

    So anyone really tried comparing?
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.