Mani rathnam Posted April 25, 2017 Share Posted April 25, 2017 Hi All, I have copied one of the existing Stats report module and created a new one. Modified the sql query inside the stat module. It is working fine. But it is taking too much resource and bringing the site down. When we asked the Prestashop support team, they said, it is because the query in the new stat module is not closing the database session after running the sql query. I am not sure how to resolve this and i am having doubt that why the same issue in not there in the existing modules. Can anyone please guide me on this ? It is happening in PROD and as of now we disabled the newly created modules. Thanks in Advance. Mani Link to comment Share on other sites More sharing options...
musicmaster Posted April 25, 2017 Share Posted April 25, 2017 Database session should be automatically closed when PHP ends. So I doubt that. In your config directory in the file defines.inc.php you will find the following line: define('_PS_DEBUG_PROFILING_', false); If you put that to true you will see at the bottom of each page a list of the mysql commands that have been run by that page - and how long they took. Link to comment Share on other sites More sharing options...
Mani rathnam Posted April 26, 2017 Author Share Posted April 26, 2017 Thanks musicmaster. Before I realize that the server is using more resources, the page is going down. I will try this option and update you. Meanwhile, can i use explicit code to close the connection. example: Db::getInstance()->disconnect(); is that right way to do ? Thanks in Advance. Mani Link to comment Share on other sites More sharing options...
musicmaster Posted April 26, 2017 Share Posted April 26, 2017 Thanks musicmaster. Before I realize that the server is using more resources, the page is going down. I will try this option and update you. Meanwhile, can i use explicit code to close the connection. example: Db::getInstance()->disconnect(); is that right way to do ? Thanks in Advance. Mani I am not sure about that. Maybe someone else knows. Link to comment Share on other sites More sharing options...
Mani rathnam Posted May 12, 2017 Author Share Posted May 12, 2017 Anyone please help me on this ? Thanks in Advance. Mani 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