LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Ramdisk performance problem (https://www.linuxquestions.org/questions/linux-general-1/ramdisk-performance-problem-902590/)

andy2008 09-12-2011 09:59 AM

Ramdisk performance problem
 
Hi guys!

I have a question regarding ramdisks. So, my problem is this:

I have multiple scripts that write multiple pictures (PNGs) (about 3 PNGs per second x 4 scripts = 12 PNGs per second). These PNGs are then converted to JPGs (in realtime). The disks ,even though they are SAS 15000 RPM, RAID 5, were kinda` struggling to keep up with the high load but performance was still pretty good. I decided a few days ago to create a ramdisk and configure those scripts to write the PNGs/Converted JPGs there (thinking it would be much faster)... Well, it ain`t ! Performance was MUCH better when writing to the physical disks. I tried various file systems for the ramdisk (ext2, ext3, ext4)... it doesn`t seem to matter, performance is still pretty bad. So my question is, am I missing something? Aren`t ramdisks supposed to be faster than physical disks?

Btw, I'm using Fedora 13 x64.

jefro 09-12-2011 08:51 PM

Ram disks are way faster than a real hard drive. I see a few issues that I need to understand. One is where are you getting the files from? A hard drive? Also what about this real time conversion. Is it using cpu bandwidth? Could your tasks be overloading the memory buss or taxing the cpu?

syg00 09-12-2011 09:26 PM

I haven't used ramdisk in years, but they are still conceptually a physical (spinning) disk. And by the sounds of it you have funnelled all the I/O from several disks to one. Bad karma in any environment. I'd be betting the I/O scheduler is still sorting all the I/O by sector and trying to optimise the head movement ... :doh:
Try using a tmpfs instead and see if that helps.

sundialsvcs 09-12-2011 10:48 PM

Nope!!

RAMdisks are created in "memory," and that means ... virtual memory ... and that means, soon enough ... swapping (to disk!).

Not good.

Switch back to the old way of doing things and let it be a lesson learned.

andy2008 09-13-2011 07:23 AM

CPU and RAM usage are below 20%, so it`s not a problem. Like I said, when writing to the HDD, performance is very good, but on a ramdisk is much slower. It`s a program that is generating the PNGs and some scripts convert them to JPEGs.

unSpawn 09-13-2011 08:16 AM

Quote:

Originally Posted by andy2008 (Post 4469723)
am I missing something?

First of all why the heck is the application writing PNG if you need JPEG? And do you actually need JPEG? And if the quality of your RAID controller is not top notch (or favor speed over redundancy), shouldn't RAID 0 do instead of 5? (Or why not just a single disk on one chain to read from and another on another chain to write to?) And performance-wise, can we assert the machine is tuned and runs only this application and nothing else so-help-you-${DEITIES}? And how did you exactly arrive at your conclusion? (BTW you know ramfs is only backed by RAM but tmpfs is backed by RAM and swap, right?) What actual commands have you used? How about sharing application and timing information?

jefro 09-13-2011 03:27 PM

Are all the files in the ramdisk or are you moving them in and out via a hard drive?


All times are GMT -5. The time now is 05:10 AM.