Post AQll6c8IX53Eva4yCe by yocum137@mstdn.social
 (DIR) More posts by yocum137@mstdn.social
 (DIR) Post #AQlhjmbL94o6s85Kq0 by stux@mstdn.social
       2022-12-19T15:18:44Z
       
       0 likes, 0 repeats
       
       I got the issue for PgBouncer but now is the question what limit.. "pgbouncer ERROR accept() failed: Too many open files"It's the user system open files limit but there are so many..Anyone an idea?#Linux #PgBouncer
       
 (DIR) Post #AQlhmC39V0aUNXF9NI by stemid@mastodon.se
       2022-12-19T15:19:14Z
       
       0 likes, 0 repeats
       
       @stux I literally linked that to you yesterday.https://www.pgbouncer.org/config.html#max_client_conn
       
 (DIR) Post #AQlhnACRrZfsvk3QC8 by ruud@mastodon.world
       2022-12-19T15:19:29Z
       
       0 likes, 0 repeats
       
       @stux Need help with that?
       
 (DIR) Post #AQli8drwkSj51shrAO by stux@mstdn.social
       2022-12-19T15:23:18Z
       
       0 likes, 0 repeats
       
       @ruud Im not sure yet what limti but i've added "fs.file-max = 100000" to /etc/sysctl.confPgBouncer uses its own user right?
       
 (DIR) Post #AQliGBeJYLtnp7vZtQ by ruud@mastodon.world
       2022-12-19T15:23:35Z
       
       0 likes, 0 repeats
       
       @stemid @stux Change it on the user level and systemwide, like this https://www.tecmint.com/increase-set-open-file-limits-in-linux/
       
 (DIR) Post #AQliHVUvF56pfkAEdc by wonkothesane@mstdn.social
       2022-12-19T15:24:58Z
       
       0 likes, 0 repeats
       
       @stux Maybe you should ask them over on the developer discord? @supernovae and a few others there are engaged and give each other good input
       
 (DIR) Post #AQliIXWDDMAWEHGAXA by ruud@mastodon.world
       2022-12-19T15:25:09Z
       
       0 likes, 0 repeats
       
       @stux Yes it should. First do sysctl -p to enable the values in sysctl.conf
       
 (DIR) Post #AQliOU3wyZobFTsJDE by GoTakeAKnapp@anti-social.online
       2022-12-19T15:26:10Z
       
       0 likes, 0 repeats
       
       @stux https://tecadmin.net/increase-open-files-limit-ubuntu/It is likely the OS throwing the error.
       
 (DIR) Post #AQliSaRTCRYEBypg8W by stux@mstdn.social
       2022-12-19T15:26:51Z
       
       0 likes, 0 repeats
       
       @ruud but my current "file-max" is 19310662 that should be enough right? I think its user level
       
 (DIR) Post #AQlimj6kgq72rPkGkS by stux@mstdn.social
       2022-12-19T15:30:30Z
       
       0 likes, 0 repeats
       
       @ruud Would this do in "/etc/security/limits.conf"pgbouncer        hard nofile 100000pgbouncer        soft nofile 100000
       
 (DIR) Post #AQliyo7LtEdRsAmpAe by ricardopersoon@mastodon.social
       2022-12-19T15:32:45Z
       
       0 likes, 0 repeats
       
       @stux Maybe it's hitting the "soft" open files limit? You could try this: https://serverfault.com/a/718978
       
 (DIR) Post #AQlj5gT2jP6kAoDA7k by Paulinebvr@todon.eu
       2022-12-19T15:33:59Z
       
       0 likes, 0 repeats
       
       @stux @lordgaav kan jij een admin een handje helpen?
       
 (DIR) Post #AQljIaHh1zNIlH3OV6 by stux@mstdn.social
       2022-12-19T15:36:11Z
       
       0 likes, 0 repeats
       
       @h3artbl33d I have now but for the ppgbouncer user?
       
 (DIR) Post #AQljX9cUS3YcPGjFmi by satan@hell.social
       2022-12-19T15:37:37.800Z
       
       0 likes, 0 repeats
       
       @stux@mstdn.social @h3artbl33d@exquisite.social If pgbouncer runs as that user - it should do the difference.What is the error you first got?
       
 (DIR) Post #AQlk2qS9FTqyEE0EyW by metalcuddle@toot.community
       2022-12-19T15:44:39Z
       
       0 likes, 0 repeats
       
       @stux max_files_per_process ?  This parameter is in postgresql.conf file Sets the maximum number of simultaneously open files for each server process https://postgresqlco.nf/doc/en/param/max_files_per_process/
       
 (DIR) Post #AQlk88fcwbWkB0pdWS by stux@mstdn.social
       2022-12-19T15:45:33Z
       
       0 likes, 0 repeats
       
       @zop @ruud Ah thought so.. it doesnt work indeedSome say it needs into the service file for PgBouncer
       
 (DIR) Post #AQlkVqRyL23KcLkUKG by desmoxytes@dice.camp
       2022-12-19T15:49:53Z
       
       0 likes, 0 repeats
       
       @stux what OS is it on? If you're using systemd, you may need to modify the systemd service file if it's running as a daemon
       
 (DIR) Post #AQlkWivbn3qRZu1v16 by stux@mstdn.social
       2022-12-19T15:49:59Z
       
       0 likes, 0 repeats
       
       How do I change the ulimit for the PgBouncer deamon on Ubuntu?
       
 (DIR) Post #AQlkcXkmFagGeqjrkm by stux@mstdn.social
       2022-12-19T15:51:03Z
       
       0 likes, 0 repeats
       
       Think I got it..
       
 (DIR) Post #AQlkkDwFo0gxWHlkjA by mpm@mstdn.social
       2022-12-19T15:52:24Z
       
       0 likes, 0 repeats
       
       @stux I think it depends on the version - see https://github.com/pgbouncer/pgbouncer/issues/729
       
 (DIR) Post #AQlknQf6xMDnqkHN8S by stemid@mastodon.se
       2022-12-19T15:53:05Z
       
       0 likes, 0 repeats
       
       @stux if you're starting it with systemd it's best to set the limit in systemd by using overrides. (systemctl edit service-name)
       
 (DIR) Post #AQlkrJu020KS2i6AIi by stux@mstdn.social
       2022-12-19T15:53:45Z
       
       0 likes, 0 repeats
       
       @mpm I need the one for init.d
       
 (DIR) Post #AQlkwkJ7Hk47NuQy6C by yocum137@mstdn.social
       2022-12-19T15:54:43Z
       
       0 likes, 0 repeats
       
       @stux I think it’s the same in RHEL/Fedora, and it’s in /etc/security/limits.conf. See https://access.redhat.com/solutions/61334
       
 (DIR) Post #AQlkyTEXjgz70i7KKG by stux@mstdn.social
       2022-12-19T15:55:02Z
       
       0 likes, 0 repeats
       
       @yocum137 Nop since it's a daemon and no user 😉
       
 (DIR) Post #AQlkzCIgBA20mZOlWK by SeekingDuck@mas.to
       2022-12-19T15:55:08Z
       
       0 likes, 0 repeats
       
       @stux have you tried turning it off and then on again? I jest, thanks for your work.
       
 (DIR) Post #AQll6c8IX53Eva4yCe by yocum137@mstdn.social
       2022-12-19T15:56:35Z
       
       0 likes, 0 repeats
       
       @stux Is it not running under the pgbouncer UID?Hold on… are you running it as a container?
       
 (DIR) Post #AQllFNRCXPoTxS6EYS by Karen5Lund@mastodon.social
       2022-12-19T15:58:09Z
       
       0 likes, 0 repeats
       
       @stux I absolutely love that Mastodon Admins are having a discussion about settings for their instances right out in public. (Even if I don't have a clue what they're actually talking about.) It's open source to the nth.
       
 (DIR) Post #AQlm2bVJ1qXdlzUbg0 by Astrid_z@mastodon.social
       2022-12-19T16:07:00Z
       
       0 likes, 0 repeats
       
       @stux
       
 (DIR) Post #AQlm7Y6R6M3uflDa2C by osfast@mstdn.social
       2022-12-19T16:07:58Z
       
       0 likes, 0 repeats
       
       @stux smart boy! 👍
       
 (DIR) Post #AQlmQHYErd9CqC9g3c by yocum137@mstdn.social
       2022-12-19T16:11:22Z
       
       0 likes, 0 repeats
       
       @stux Everything on Linux runs as a user. That user might be “daemon” but it’s still a user.  Not many processes run as user daemon any more - they run as the specific user of the process, so that’s likely “pgbouncer” in this case.If it’s running as user “root” then something is wrong! Pgbouncer most certainly does NOT need elevated system privileges - it just aggregates db connections.
       
 (DIR) Post #AQlnw613O3xiHmMoQy by PeltonenJanne@mstdn.social
       2022-12-19T16:28:19Z
       
       0 likes, 0 repeats
       
       @stux The way I'd do this would be as follows:1) Create a directory /etc/systemd/system/pgbouncer.service.d2) In there, create a file filelimit.conf3) In that file, insert[Service]LimitNOFILE=16384(or some other high number)4) Say systemctl daemon-reload && systemctl restart pgbouncer5) Check that it works: sudo prlimit --pid $(ps -ef|grep pgbouncer|grep -v grep|awk '{ print $2; }') -n(the check above supposes pgbouncer only has one process, I'm not familiar with that particular daemon)
       
 (DIR) Post #AQlo8L831XXcdGTcDA by yocum137@mstdn.social
       2022-12-19T16:30:32Z
       
       0 likes, 0 repeats
       
       @stux How much RAM do you have? If you have a lot, then 40000 for hard  and 30000 for soft.
       
 (DIR) Post #AQlrpRSjePrEafOhSy by Maxanadu_MX02@masthead.social
       2022-12-19T17:11:54Z
       
       0 likes, 0 repeats
       
       @stux *scratches chin thoughtfully*Um…Is this a fire type or steel type creature?