Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

winnfsd CPU load #106

Open
jazzfog opened this issue Feb 9, 2017 · 3 comments
Open

winnfsd CPU load #106

jazzfog opened this issue Feb 9, 2017 · 3 comments

Comments

@jazzfog
Copy link

jazzfog commented Feb 9, 2017

Lately I started to notice that sometimes winnfsd process start to consume enormous amount of CPU - about 40%. Tried to analyze it with Sysinternals Process Explorer and Process Monitor but didn't find what does it do and why.

It was OK for last couple months since I started use it but this issue appeared 4 times over last week or two.

Has anyone seen something like this?

winnfsd

@JakeTheSnake3p0
Copy link

JakeTheSnake3p0 commented Feb 13, 2017

I've had similar issues lately on one of my boxes, but I can't pin down exactly what's failing.

Here is the debug log for the plugin, though I don't think it'll be much help. When winnfsd.exe fails, it hangs around 25% CPU utilization +/- 2% indefinitely and no errors are logged to the cmd prompt.

...
[18:53:04] NFS READ \\?\D:\git-repositories\ruby\pos\db\migrate\20160712212803_a
dd_discountable_to_items.rb  OK
# It is at this point that the fail occurs.
# Everything below this line is written after `vagrant reload`
# without having closed winnfsd.exe
PORTMAP GETPORT 100003 2049
[18:58:00] NFS NULL OK
PORTMAP GETPORT 100005 1058
MOUNT NULL
MOUNT NULL
MOUNT Path D:/git-repositories/ruby with path alias /D/git-repositories/ruby alr
eady known
MNT from [redacted ip]
Final local requested path: \\?\D:\git-repositories\ruby

PORTMAP GETPORT 100003 2049
[18:58:00] NFS NULL OK
[18:58:00] NFS FSINFO \\?\D:\git-repositories\ruby  OK
[18:58:00] NFS PATHCONF \\?\D:\git-repositories\ruby  OK
...

Something to note:

If I don't close winnfsd.exe at all, it fails in increments of 25%.

  1. vagrant up
  2. Work with system, causing error and console lock (typing with no prompt or prompt response). CPU utilisation for winnfsd.exe now @ 25%.
  3. vagrant reload
  4. Repeat step 2 + 3, CPU utilisation now @ 50%
  5. Repeat step 2, CPU utilisation now @ 75%
  6. Close winnfsd.exe out of anxiety

There is no high CPU/memory usage on behalf of VirtualBox, it's just winnfsd that hangs. I can't speak to why, but the situations where I've encountered it are:

  1. When using bundle install/update; failed right after the last using [gem] console output, but never when calculating gem dependencies.
  2. When running bundle exec rails db:migrate RAILS_ENV=test at some point during the course of a ruby error (undefined method 'id' for nil:NilClass or some type of StandardError).

Using

  • Vagrant on Windows 7 x64 hosting Ubuntu 14.01 on VirtualBox
  • RVM with Ruby 2.4.0
  • Rails app is 5.0.1
  • VirtualBox settings: 100% CPU execution cap, 4 CPUs in use, 2GB RAM

-- UPDATE

I've also tried dropping my old vagrant box completely and use Ubuntu 16.04. I've completely done a fresh install of everything and the problems occur in the same places. I also tried using Ruby 2.3.1 (working previously) and the problem maintains.

The only observation I could provide is that this might be happening when there is simultaneous high CPU load and NFS file access. The issue is currently restricted to my Rails applications but maybe there's some sort of stress test out there I can run on one of my NFS exports from within Ubuntu?

@JakeTheSnake3p0
Copy link

Turns out changing to UDP avoids the issue for me altogether; your mileage may vary. I also added noatime to the mount as it wasn't necessary for me to track last-accessed stats.

config.vm.synced_folder 'D:\git-repositories\ruby',
                          '/home/ubuntu/apps',
                          nfs: true,
                          mount_options: [
                            'vers=3',
                            :udp,
                            :nolock,
                            :noatime,
                            :rw
                          ]

@jim5359
Copy link

jim5359 commented Dec 20, 2018

UDP does not solve the problem for me. I still get high CPU loads occasionally. Often times when doing Git operations which involves a large number of modified files, such as a git checkout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants