I'd like for MySQL queries to have a long-ish timeout, but the initial connection timeout to be short. E.g. If a process can't connect for 3 seconds, assume the server may be overloaded and fail right away (rather than queuing up httpd connections), but if the MySQL connection occurs quickly, give queries plenty of time to complete.
While I assume I can specify a server-wide connection timeout via MySQL's config, it looks impossible to configure within PHP because, as the manual says, "On Linux [the
mysql.connect_timeout] setting is also used for waiting for the first answer from the server."
Does "the first answer" mean the result of the first query? Does
SET NAMES 'utf8' count?
Does this imply
mysql.connect_timeout applies to all queries on Linux?