3 ms·
> I was asked what timeout I would set on a database connection. I was more thinking about how long an individual user could be prepared to wait for a page to r
by layer8 3y ago
> I was asked what timeout I would set on a database connection. I was more thinking about how long an individual user could be prepared to wait for a page to render, so blurted out too high of a number.
Interesting, I would have put those in the same ballpark. Anyone who can shed light on this?
- mberger 3y agoI would have had to ask if it was load balanced. If it is, i would have said half the time for the requesting service minus 10 percent. Gives the query time to retry with some margin. This would be my opinion, not something I've read up on.
- jacurtis 3y agoI agree. This is a weird reason to discontinue interviewing someone. This is the type of factoid that can easily be learned by someone on the job. If you want to reset db connections after 500ms instead of 15 seconds, then fine. But its the type of thing your company can just say they want to do and you do it, its not really something worth hiring around. Not to mention, you really should be connecting to a DB Pooler anyway, which handles your DB connections, rather than designing the individual implementation within the application or micro-service and try to keep all your services aligned.