Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
My first suggestion would be to go with the filesystem, opening up levels of subdirectory as needed. (My second note would be that if this is an email storage system, there is a lot of prior code on this, check out some of the free IMAP servers).

Note that not all filesystems are created equal. They each make different tradeoffs and some will have much better performance for this load than others.

A journalling filesystem should perform better for a write-heavy load than a non-journalling fs. Disks are fastest when you are writing (or reading) lots of sequential data. File creation and updates will go to the (hopefully sequential) journal and should help a lot. If you simultaneously have a heavy read load, you'll lose a lot in performance - due to seeking - unless you can satisfy most reads from cache (which is, for example, the case in an MTA email queue under most sensible queueing strategies).

Your measurements showing that writing larger files is quicker is surprising. Can you try a 'strace' on the two cases in question to see if the application code is doing anything different in the two cases?

Can you tell any more about the application and expected access patterns? It sounds interesting.


In reply to Re: Perl solution for storage of large number of small files by jbert
in thread Perl solution for storage of large number of small files by isync

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-16 05:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found