Seafile 6.2.x (WSGI mode) Idle CPU Usage too High

@Martin Just to make it specific: Which seafile version are you using?

6.2.2 CE on Debian Jessie x64

Using WSGI, the python processors will communicate with a master processor even when idle. So I think such CPU usage is normal.

Using CPU whilst ‘idle’ is the opposite of being ‘idle’, whether it’s normal or not for WSGI. This kills all power management strategies.
Well this thread’s easily found via Google now, so for those server admins reading with small users; ignore the docs and keep fastcgi.

1 Like

FastCGI is in deprecated state and will be removed after some time …

Am I right?

But why, as it is state of our investigation now, is there the “high” idle CPU usage only with 6.2.x and not with 6.1.x with WSGI?

3 Likes

The only difference from 6.1.x is that in seafile-server-6.2.x/runtime/seahub.conf, there are:

workers = 3
threads = 5

Can you try remove the two lines and restart Seahub?

2 Likes

@pod0087 @Martin @scheff @P-atrick-B

Yes, this worked. The CPU load is as expected (all 0,0% CPU when idle - first line behind “S”, the second is memory usage):

Can I leave the lines out?

3 Likes

Yes, this reduces the load.

2 Likes

Fixed for me too

2 Likes

So they will be left out in further releases on default I guess?!

1 Like

It does not to seem like the lines are removed.
Yesterday I updated from 6.1.9 Pro (with WSGI mode) to 6.2.4 Pro (with WSGI mode) and I realized unnecessary CPU usage of Seahub when idle, too.
I checked “…/runtime/seahub.conf” and the mentioned lines are present in 6.2.x:

...
daemon = True
workers = 3
threads = 5
...

Before the update I especially checked the changelog (https://manual.seafile.com/changelog/changelog-for-seafile-professional-server.html) to see, if there is some news about it or some instructions which one have to comply with.

@daniel.pan

  1. Are these special settings now the default settings for Seahub and with this, is the extra idle CPU usage deliberate and wanted or calculated (e.g. trade-off, etc.)?

  2. Why were these settings set/were necessary and are there other impacts on server’s behavior?

  3. Is it a save and supported way to remove the mentioned lines? And what would be the difference/advantage/disadvantage of doing it? (performance, number of clients or site accesses, etc.)

  4. If removing the lines is save, it will be good that these change and the impact to the CPU usage is documented somewhere.

Thanks

2 Likes

The lines are added back for performance reason.

For production environment for 200+ users, workers = 3 and threads = 5 is recommended configuration. This means there are in total 15 threads to serve the requests from users. If the value is too small, the requests will pile up.

If you use 15 workers, there will be too many python processes and use a lot of memory.

For personal usage, you can remove threads = 5.

As said in another thread, we will make the config file to conf directory in the 6.3, so people can customize the configuration and preserve the configuration during upgrade.

4 Likes

Please also move workers to the config file. Thanks!

Hello,
It’s still not effective this change in version 6.3.4 pro ?

I don’t know what you mean. In version 6.3, the config file is put under conf directory and you can customize.

where exactly ?

Because I found the parameters in
/home/seafile/seafile-server-latest/runtime/seahub.conf

The config file is no longer used. The new one is conf/gunicorn.conf

Okay, thank you very much.