lundi 21 septembre 2015

Unused write database connections

This issue was raised using Laravel 5.0.

My project's database setup consists of 1 write node and multiple read-replicas (postgresql). Everytime a connection is initiated for any query, eg:

php <?php $user = \App\User::find(1); ?>

... a connection is made to the write node. This occurs even when no writing queries are run (including set names 'utf8', etc); a connection will be set up, but all the SELECT queries are run correctly on the read-replicas.

How can I avoid this write connection if I don't need/use it for read-only requests?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire