LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 09-12-2011, 09:59 AM   #1
andy2008
Member
 
Registered: Nov 2010
Posts: 40

Rep: Reputation: 2
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.
 
Old 09-12-2011, 08:51 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,001

Rep: Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629
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?
 
Old 09-12-2011, 09:26 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
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.
 
Old 09-12-2011, 10:48 PM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,672
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
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.
 
Old 09-13-2011, 07:23 AM   #5
andy2008
Member
 
Registered: Nov 2010
Posts: 40

Original Poster
Rep: Reputation: 2
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.
 
Old 09-13-2011, 08:16 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by andy2008 View Post
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?
 
Old 09-13-2011, 03:27 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,001

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


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RAMDISK: couldn't find valid ramdisk image starting at 0. iotc247 Slackware 10 12-10-2010 03:08 PM
Lighttpd performance problem + RAID performance problem in a high load site phaz0r Linux - Server 0 11-16-2008 08:52 AM
problem with ramdisk KitKat08 Debian 2 02-09-2006 08:57 AM
problem with ramdisk KitKat08 Linux - Newbie 3 02-09-2006 01:33 AM
creating a ramdisk runtime from another ramdisk code123 Linux From Scratch 0 10-11-2004 08:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration