Optimizing Nginx for Seafile?

I’m trying to optimize Nginx for Seafile.

What I have done so far is:

grep ^processor /proc/cpuinfo | wc -l

To change the “worker_processes” to the perfect setting, in my case it was 8.

Also I have done:

ulimit -n

To change the “worker_connections” to the perfect setting, in my case it was 1024.

So what more can I do?

Should I turn on the “multi_accept” option?
Also I did read somewere that I should do: “use epoll;” is that correct? Should I add the “use epoll;” option?

@DerDanilo do you know anything about this?
You are running nginx correct?

I run nginx, correct.
We will add the recommended nginx config to the new server manual we are writing.

1 Like

Ok, and when I’ll you update it?

What version is the latest one for nginx? The stable on?

of course.

1 Like

Yes, as I wrote in other posts.

We are working on it. It is not linked in any way to the manual that is provided and managed from the Seafile devs.
I will have to check the next weeks when I have time to check on the progress since I’m not the only one working on this.

1 Like

Ok great! I understand, big thanks.

Do you know how I can download the latest stable nginx version?
I’m on 1.12.1 now and I have added there ppa.
But it seem that 1.12.2 is the latest stable one but I can’t find out where to download it.

I did find the respo for it. Wondering why ubuntu 16.04 LTS don’t update to the latest stable as default.

You checked this right?


deb http://nginx.org/packages/ubuntu/ codename nginx
deb-src http://nginx.org/packages/ubuntu/ codename nginx

You don’t need another version than Ubuntu LTS provides. You should not use PPAs unless there is a special use case.

Yes, I did find that after I did ask the quastion so I did replace the official PPA with that.

One more question, do you use fail2ban to protect your nginx?
If yes, what filter are you using?

Don’t go for the mainline ppa, stable is fine.

There is a custom f2b filter for Seafile, it will be included in the new manual.

That fail2ban I know about, but it has a “bug” you need to set the time_zone in the seahub_settings.py and also it’s good to have the noproxy and nohome filter for fail2ban.

I’ll also send in some clearification trough github, some things need to bee cleared out - not a guide, but explane what happens with some things etc.