Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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?
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 ...
Try using a tmpfs instead and see if that helps.
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.
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.