JimNutt Posted July 31, 2015 Share Posted July 31, 2015 Has anyone had any luck with using a Slave server for reads? I have added the slave to config/db_slave_server.inc.php return array( array('server' => 'xxxxxxxxxxxxxxx.rds.amazonaws.com', 'user' => 'xxxxxx', 'password' => 'xxxxxxxx', 'database' => 'upshop'), ); I have set define('_PS_USE_SQL_SLAVE_', 1); in config/defines.inc.php I restarted apache just to be sure PS would pick up the settings, which it did, yet no activity on the slave server (more precisely no connection with the username provided in the connection string) In classes/db/Db.php I see 2 total servers (master + slave) if I echo $total_servers, I also see the correct server info if I echo self::$instance. I have verified the following: I can connect and run a select query against my slave server from the PS web server I did try turning on debug profiling as I saw mention that it would indicate if queries were running against a slave, but I don't see anything that identifies if it is running against the master or the slave define('_PS_DEBUG_PROFILING_', true); So as far as I can tell PS is not using the Slave Server in any of the queries it is using, any help would be appreciated Link to comment Share on other sites More sharing options...
indiakingarun Posted July 4, 2018 Share Posted July 4, 2018 I know this is late reply, but if anyone looking for answer this will be a time saving deal for them. You need to use zero instead of 1 in the definition. define('_PS_USE_SQL_SLAVE_', 0); define('_PS_USE_SQL_SLAVE_', 1); Here, 1 will be used to consider data from master db instead of slave db. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now