養動物時 mount.ntfs 100% CPU usage [論壇 - 新手村]


正在瀏覽:   1 名遊客


 到底部   前一個主題   下一個主題  [無發表權] 請登錄或者註冊



養動物時 mount.ntfs 100% CPU usage
會員一級
註冊日期:
2012/9/18 15:21
所屬群組:
已註冊使用者
等級: 2
HP : 0 / 43
MP : 5 / 1363
EXP: 74
離線
最近養動物時 突然發現mount.ntfs 100% CPU usage https://imgur.com/G2NY6Nohttps://imgur.com/G2NY6No



爬文後不太能理解,能否請前輩先進開示,感謝
sudo lsof <path_to_NTFS_mount>
[/color][/size]
sudo lsof /path/to/NTFS

Thanks to the following command (executed when the problem shows up):
Code:
sudo lsof <path_to_NTFS_mount>



As Jaromanda X said in the comments, a few google searches on NTFS Linux performance shows this is not uncommon.

Probably the first step gleaned from several threads on the topic is to use lsof to verify which process is slamming your NTFS partition: we're assuming Transmission but maybe it's something else:

sudo lsof /path/to/NTFS

One thread suggests that disabling updatedb.mlocate from cron was a big help. Another thread suggest small writes to the Linux NTFS FUSE driver are particularly CPU intensive, and that would be exactly what a BitTorrent client would be doing. One option might be to look into increasing cache sizes in Transmission to have less frequent writes.

Additional reading suggests more fragmentation makes the CPU utilization worse, and certainly a larger filesystem with lots of small writes (ie. BitTorrent) is likely to have high fragmentation.

So the short answer to your question of "is this a common occurrence" is: yes, high CPU is a known problem with NTFS drivers doing writes on Linux. There are any number of things you might be able to do to help tune to make it better, but you've got a lot of trial and error testing ahead of you, there doesn't seem to be any consistent "fix all" answer for the performance issues you are seeing.

I easily found that the 100% CPU load is created by the updatedb.mlocate script run by cron once per day to update the locate database (man updatedb for more info).

For some reason, updatedb.mlocate thinks that all directories on the NTFS partition have been changed and performs a full rescan of the partition which creates high CPU load due to the limitation of the free version of the ntfs-3g driver used in Ubuntu (this limitation is well known and described somewhere else).

A possible workaround is to append the path to the NTFS mount point to the PRUNEPATHS variable in /etc/updatedb.conf to exclude this mount point from the process of updating the locate database.

The fact that updatedb.mlocale thinks all directories on an NTFS partition are always new is probably related to the way how inodes are represented by ntfs-3g. It's just a guess -- I haven't looked into details; if someone does and has a solution preventing full rescanning on each run, I would like to hear it here as this would be a more correct solution than excluding the whole mount point from updating.https://imgur.com/G2NY6No

附件:



bmp  螢幕快照_2018-06-21_02-40-59.bmp (252.51 KB)
32384_5b2b335bc1259.bmp 1024X768 px

jpg  螢幕快照_2018-06-21_02-38-12.jpg (436.36 KB)
32384_5b2b3486f2b6b.jpg 1024X768 px

2018/6/21 13:26
應用擴展 工具箱
回覆: 養動物時 mount.ntfs 100% CPU usage
會員三級
註冊日期:
2006/1/11 0:33
所屬群組:
已註冊使用者
等級: 12
HP : 0 / 280
MP : 57 / 14227
EXP: 21
離線

2018/6/22 12:15
這個站可以廢了, 很愛言論審核, 發廢文亂回答答錯的卻很快就審核通過
應用擴展 工具箱


 [無發表權] 請登錄或者註冊


可以查看帖子.
不可發帖.
不可回覆.
不可編輯自己的帖子.
不可刪除自己的帖子.
不可發起投票調查.
不可在投票調查中投票.
不可上傳附件.
不可不經審核直接發帖.