Forum: NGINX nginx on Tru64/alpha

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Dustin Marquess (Guest)
on 2009-02-23 02:00
(Received via mailing list)
Hello.

I recently installed nginx 0.7.37 on Tru64 5.1B-4 using Compaq C
V6.5-303 compiler.

Everything works great if I leave the default of worker_processes set
to 1.  However, if I increase it to 2 (since this machine has 2 CPUs),
I immediately start getting a flood of fcntl errors in the error.log.

Running truss on the process shows that both processes attempt to lock
the same nginx.lock.accept file, which is what causes the problem.

Is this a known problem, and is there a workaround?

Thanks!
-Dustin
Igor S. (Guest)
on 2009-02-23 11:26
(Received via mailing list)
On Sun, Feb 22, 2009 at 05:49:31PM -0600, Dustin Marquess wrote:

> I recently installed nginx 0.7.37 on Tru64 5.1B-4 using Compaq C
> V6.5-303 compiler.
>
> Everything works great if I leave the default of worker_processes set
> to 1.  However, if I increase it to 2 (since this machine has 2 CPUs),
> I immediately start getting a flood of fcntl errors in the error.log.
>
> Running truss on the process shows that both processes attempt to lock
> the same nginx.lock.accept file, which is what causes the problem.

Could you shou the error messages ?

> Is this a known problem, and is there a workaround?

Try

events {
    accept_mutex  off;
    ...
}
Dustin Marquess (Guest)
on 2009-02-24 04:34
(Received via mailing list)
On Mon, Feb 23, 2009 at 3:09 AM, Igor S. <removed_email_address@domain.invalid> 
wrote:
>> the same nginx.lock.accept file, which is what causes the problem.
>
> Could you shou the error messages ?

The log file shows:

2009/02/24 02:17:02 [alert] 438988#0: fcntl(F_SETLK, F_WRLCK) failed
(13: Permission denied)
2009/02/24 02:17:03 [alert] 438988#0: fcntl(F_SETLK, F_WRLCK) failed
(13: Permission denied)
2009/02/24 02:17:03 [alert] 438988#0: fcntl(F_SETLK, F_WRLCK) failed
(13: Permission denied)

Truss shows:

438988: fcntl(7, F_SETLK, 0x000000011FFFBC28)           Err#13
Permission denied

going farther back in the truss shows that fd 7 is the mutex:

438988: open("/usr/local/nginx/logs/nginx.lock.accept",
O_RDWR|O_CREAT, 0644) = 7
438988: unlink("/usr/local/nginx/logs/nginx.lock.accept") = 0

>> Is this a known problem, and is there a workaround?
>
> Try
>
> events {
>    accept_mutex  off;
>    ...
> }


Awesome, that seems to work!

Thanks!
-Dustin
Igor S. (Guest)
on 2009-02-24 09:00
(Received via mailing list)
Attachment: patch.tru64 (0 Bytes)
On Mon, Feb 23, 2009 at 08:22:24PM -0600, Dustin Marquess wrote:

> >> Running truss on the process shows that both processes attempt to lock
> 2009/02/24 02:17:03 [alert] 438988#0: fcntl(F_SETLK, F_WRLCK) failed
> 438988: unlink("/usr/local/nginx/logs/nginx.lock.accept") = 0
The attached patch should help.
This topic is locked and can not be replied to.