savannah-hackers-public
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Savannah-hackers-public] Max connections hit on database


From: Assaf Gordon
Subject: Re: [Savannah-hackers-public] Max connections hit on database
Date: Sat, 17 Dec 2016 23:55:47 -0500

> On Dec 17, 2016, at 23:13, Assaf Gordon <address@hidden> wrote:
> 
>> On Dec 17, 2016, at 16:48, Bob Proulx <address@hidden> wrote:
>> 
>> [...] Yesterday we started to see some spikes which hit the process
>> limits of 150 for a couple of hours.
> 
> This does seem to coincide with the cvs switch to the new server.

I have verified (with strace,ltrace) that the new cvs binary running in 
'pserver' mode as user 'nobody' does call "getpwnam(3)" on user 'nobody' which 
triggers an database query due to libnss-mysql.

===
address@hidden:/tmp# grep -A 4 getpwnam 
cvs.ltrace-100.37.92.116-2016-12-17-234502.log 
13870 getpwnam("nobody")                         = 0x7f18a8399240

address@hidden:/tmp# grep -C 4 getpwnam 
cvs.strace-100.37.92.116-2016-12-17-234334.log 
13325 futex(0x7fd8abf811c0, FUTEX_WAKE_PRIVATE, 2147483647) = 0
13325 open("/etc/libnss-mysql.cfg", O_RDONLY) = 3
13325 fstat(3, {st_mode=S_IFREG|0644, st_size=6423, ...}) = 0
13325 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) 
= 0x7fd8ae7de000
13325 read(3, "getpwnam    SELECT user_name, 'x"..., 4096) = 4096
13325 read(3, "ND groups.gidNumber >= 1000 \\\n# "..., 4096) = 2327
13325 read(3, "", 4096)                 = 0
13325 close(3)                          = 0
13325 munmap(0x7fd8ae7de000, 4096)      = 0
===

I wonder if there's a way to tell libnss-mysql to skip the query for local 
users if they are in /etc/passwd ?

Or should we look into modifying the cvs binary (perhaps there's a simply 
runtime option).

I'll look into it.

- assaf





reply via email to

[Prev in Thread] Current Thread [Next in Thread]