#1
  1. manwich
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2003
    Location
    Canadanistan
    Posts
    578
    Rep Power
    385

    Keeping a RAMdisk out of swap


    I'm using some milters on a Sendmail box that recommends using a RAMdisk [tmpfs] to store temporary files, the performance benefits of which are quite noticeable. However, the problem is if a huge number of messages are all delivered at once this partition can be pushed off the physical memory and into swap. When this happens the performance tanks to about 1/20th to 1/30th of normal.

    Is there anything I can do to keep a tempfs from being swapped to disk?
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,316
    Rep Power
    7170
    if a huge number of messages are all delivered at once this partition can be pushed off the physical memory and into swap
    um, if it doesn't swap you're going to lose the messages themselves rather than just losing some performance.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  4. #3
  5. manwich
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2003
    Location
    Canadanistan
    Posts
    578
    Rep Power
    385
    Well I don't really mean to say "physical memory or bust" but rather "push everything else that can be put into swap into swap before the tmpfs".

    The big picture really boils down to doubling the RAM in the machines, which we are doing very soon. But this is not a negligible performance decrease... Just a moderate spike in normal mail load across a cluster of 10 of these boxes caused them to dip into swap, scan times jumping from 400ms avg to 13,000ms avg for the span of a few minutes. Just a couple weeks ago we hit a corner case, a "Perfect Email Storm" if you will, that pushed scan times past the minute mark. Resolving that took some rather... drastic measures.

    Anyhow, despite all of the other steps I've been taking to mitigate performance hits I am still a bit paranoid. Is there truly no way to set such a preference as to leave tmpfs in the physical memory?
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2011
    Posts
    1
    Rep Power
    0
    I'd like to hear a solution to this as well. I have a monitoring application that runs in a ramdisk chrooted jail. It is specifically waiting for a condition where the system has started thrashing and all other logging fails. In this case it will email an admin reporting the current condition of the system, but if it is paged out as well it will fail.

IMN logo majestic logo threadwatch logo seochat tools logo