LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 02-03-2016, 08:04 PM   #1
niftyhamster
LQ Newbie
 
Registered: Feb 2016
Posts: 10

Rep: Reputation: Disabled
Question Fun with SSDs and Linux


Hi,

I am running a small server with 8 gigz ram and a cute little Intel Atom and a Samsung 120 Gigz SSD.

Linux niftypika 3.2.0-4-amd64 #1 SMP Debian 3.2.73-2+deb7u2 x86_64 GNU/Linux

Life was good, everything was okay. After 1 week of running this little guy my i/o load got up.

top - 01:49:49 up 9 days, 13:51, 1 user, load average: 8.00, 7.71, 7.45 Tasks: 133 total, 2 running, 131 sleeping, 0 stopped, 0 zombie %Cpu(s): 5.4 us, 3.5 sy, 0.9 ni, 39.0 id, 50.7 wa, 0.0 hi, 0.5 si, 0.0 st KiB Mem: 8186596 total, 6800764 used, 1385832 free, 16528 buffers KiB Swap: 14648316 total, 462764 used, 14185552 free, 3545444 cached

I download a lot of stuff, (normal tcp/ip, no p2p encrypted traffic etc) and things started normal. The server had no issue at all to copy the 5-800 Mbit traffic to disk. Now, every day things get complicated. Every day the i/o load gets worse.

IOTOP showed me what the problem was:

2361 be/4 root 0.00 B/s 0.00 B/s 0.00 % 99.47 % [flush-8:0] 1412 be/3 root 0.00 B/s 107.03 M/s 0.00 % 99.55 % [jbd2/sda4-8]

but it also showed me the system "only" wrote around 70 megz /sec and this is a SSD. (I checked it twice

Total DISK READ: 14.27 K/s | Total DISK WRITE: 65.75 M/s

I googled it and I really got no good answer for this behavior. Perhaps anyone has a clue what is wrong and most importently how I can fix it?

Thanks for reading

niftyhamster
 
Old 02-04-2016, 06:49 AM   #2
Pyrotech72
Member
 
Registered: Jan 2016
Location: Tennessee
Distribution: several, but trying to get away from systemd while keeping KDE and KVM
Posts: 45

Rep: Reputation: 11
Have you done fstrim on all the partitions?
 
1 members found this post helpful.
Old 02-04-2016, 07:09 AM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
1. Make sure that you use a filesystem that is suitable for SSDs, like ext4, btrfs, xfs or jfs. These filesystems have TRIM support, which is necessary to keep good write performance.
2. Either mount the filesystem(s) with the discard option (which in some cases can decrease performance, especially when deleting large trees) or, IMHO the better option, set up a cron-job or systemd timer to run fstrim once in a while. This will make sure that unused blocks on the SSD are internally marked as unused, so that the SSD controller can keep up its work with good performance.
 
1 members found this post helpful.
Old 02-04-2016, 08:55 AM   #4
niftyhamster
LQ Newbie
 
Registered: Feb 2016
Posts: 10

Original Poster
Rep: Reputation: Disabled
YEAH! Thats it guys! Why does Debian not have any auto trim feature/cronjob/whatever?

But thank you very much for the help <3
 
Old 02-04-2016, 09:08 AM   #5
Pyrotech72
Member
 
Registered: Jan 2016
Location: Tennessee
Distribution: several, but trying to get away from systemd while keeping KDE and KVM
Posts: 45

Rep: Reputation: 11
Quote:
Originally Posted by niftyhamster View Post
YEAH! Thats it guys! Why does Debian not have any auto trim feature/cronjob/whatever?

But thank you very much for the help <3
I would think that since SSD's are pretty new, and automatic recognition of them has probably not been worked on extensively. This will probably get better with time. You might also want to set the "noatime" option in the fstab for each partition on the SSD.


Mine (only for the SSD) look like this:

<code>
/dev/disk/by-uuid/be5255b7-c6fa-4429-8c3d-fec5b2391266 / ext4 acl,noatime,user_xattr 1 1
/dev/disk/by-uuid/7e14d174-22ef-4633-8883-0823c6a55f0c /boot ext4 acl,noatime,user_xattr 1 2
/dev/disk/by-uuid/6a2fb00a-5d74-4f29-95d8-f09ef967733d /usr ext4 acl,noatime,user_xattr 1 2
/dev/disk/by-uuid/463d9ec2-8481-4120-9dcb-28bd78bef6cc /var/lib/libvirt/svt ext4 acl,noatime,user_xattr 0 0

</code>
 
1 members found this post helpful.
Old 02-04-2016, 09:25 AM   #6
niftyhamster
LQ Newbie
 
Registered: Feb 2016
Posts: 10

Original Poster
Rep: Reputation: Disabled
In the consumer end market around 6-7 years? As a old guy I really know what fragmentation is but I never even thought of it because Windows + Mac OS X are taking care of it without user interaction. One reason I got hit hard on this could be many crypto currency demons running in the background. The amount of fragmented databases must have been enormous ...

Thanks again
 
Old 02-04-2016, 03:39 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,008

Rep: Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629
Glad you have it solved. Yes, it seems that trim is not fully automatic on many OS's still.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Should I Get SSDs or HDDs for Linux Builds phdam8 Linux - Newbie 4 07-09-2015 12:13 AM
[SOLVED] Linux with SSDs Dornith Linux - Newbie 6 01-02-2013 12:04 PM
Performance on Linux of SSDs with hardware raid, good? abefroman Linux - Hardware 1 02-04-2012 05:25 PM
Linux and SSDs- do they work well together? Earl Parker II Linux - Hardware 9 11-27-2009 07:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 04:01 AM.

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