Probably not as you only restarted. The limit is when you have create a new
connection and don't use an existing one.
I don't see a way to reuse an existing connection yet if the number of persistent connections after a restart should increase from 0 to 40K I miss something obvious? (We tried changing the client_limit value for imap-login (in order to reduce the number of processes), but in our experience it works correctly only within 3-5 and at higher values imap-login stops responding quite quickly.)
I can't really write anything useful. On the client side MUA you can't do anything these are all 'unique' connections. You can only optimize to your connection to the database. But I am not using this kind of setup. So I don't really know. I am using ldap and ldap stuff is being cached by sssd or nslcd.