G
G
gosvamih2014-09-05 19:03:37
Debian
gosvamih, 2014-09-05 19:03:37

How to find out in which folders and what processes are written to the SSD?

Debian Wheezy home server. 1 SSD 120Gb + 2HDD 1Tb. Nginx + MariaDB+Proxy DNS (PDNS) +php-fpm5.3+ZendOpcache+Redis+FTP+samba+postfix+procmail+vnstat+SSH+drush+SOLR+transmission+Drupal 4 sites - Aegir, Chive, Webmin - control panels . And more little things. :)))
Two soft raids.
SSD + HDD partition 1 in a hybrid raid is a mirror, HDD with the writes mostly parameter, which means that writing mainly goes to it first, and reading is mainly from SSD. + the second HDD partition is specified as spare for hot swap.
The second raid is a mirror, sections of 800Gb on the HDD.
Two more 4Gb partitions at the end of each disk are not in the raid. One for swap, the other for /var/log.
Mount options - relatime, scheduled TRIM once a week via script in cron.weekly, logs in /var/log
On (mirror from) SSD system and everything else, on HDD download torrents and file archive.
Something constantly writes small files to the SSD. In total, 6-8Gb is collected per day. In general, this is not scary, because the 5-year warranty takes into account up to 20Gb records per day, but it annoys me that it is written in small files (iotop shows), which is highly undesirable for an SSD. Of course, I can trim more often, but I would like to find out who writes where and, if possible, transfer these folders (except for the database and caches like radishes, because then why SSD). But it turns out to be difficult to find which process writes to which folder. Rummaged through Google, some terrible solutions through memory dumps. Is there any easy way to find out who writes to where, for example, through the time of updating files or something else? How would you solve this problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Cheremisin, 2014-09-05
@leahch

lsof utility /my/mount/folred

G
gosvamih, 2014-09-05
@gosvamih

In short, the culprit process seems to have been found. Through the output of iotop -oa. This is the kernel process that logs arrays and disks.
285 be/3 root 0.00 B 86.00 M 0.00 % 0.63 % [jbd2/md2-8]
Moreover, the "bastard" constantly writes something about arrays, the flow of logs regarding partitions is not great. You need to find out where he writes and how to fix it. Solution found:

in the /usr/lib/pm-utils/power.d/journal-commit file
, you need to change one line JOURNAL_COMMIT_TIME_AC=${JOURNAL_COMMIT_TIME_AC:-0}
instead of zero, I put 120

However, I don't have such a file. pm-utils is not installed because neither sleep nor disk halt is used.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question