my site is very slow and i disabled the bulk of modules, so I think it was my hosting, first I upped the memory limit from 90M to 256M which helped with "500 errors" but the site is still very slow. I am thinking it may be the database settings, I am changing them with the module "drupal tweaks" for convenience.
Define "slow". Is your page slow to appear? If so, is it taking a while to load the page's HTML, or is much of the time spent trying to load CSS, JS, images, etc.? The "Net" panel in Firebug can help here, as can wget
.
If the page itself is slow, is the slowness encountered at the network, Web server, PHP, or database level? Network slowness is easy to diagnose; try a ping. Either the network or the web server can show faults through the simple test of just throwing a big, static file somewhere on the server and then downloading it. PHP or DB slowness will show up when you look at the page with the devel
module, but DB slowness can generally also be seen as long-running (as opposed to long-sleep
ing!) processes in the output of SHOW PROCESSLIST
.
Alternately, give NewRelic a try. It will automate several of these steps, and give you fancy graphs, to boot.
Lastly: Consider getting a better hosting provider, ideally one with a great deal of Drupal experience (like BlackMesh or Acquia). At a great host, fixing this issue (if it arose in the first place) would be a collaborative effort between the hosting provider and the customer, rather than something you have to figure out on your own. It doesn't take many (billable) hours spent debugging hosting before you've paid for better hosting than you're getting now.
If you have a staging or development copy of the site, try installing the Devel module, which has an option for logging and appending stats about each query to the bottom of each Drupal page. That should help you track down the offending query or queries.
Here are some optimisation tips you might try.
First it is possible that your cache table should be messed up. Try to log in your phpmyadmin and try to flush all your cache tables (don't delete the tables just empty them).
Check inside the MySql installation folders config file alternative like: my-large.ini, my-huge.ini and try to rename them and copy them as bin/my.ini they are out of the box optimisations for your mySQL database.
You never mentioned the Drupal version you use. Drupal 7 has a brand new database API build on top of PHP PDO objects.
Here is a link that will help you a lot: http://drupal.org/node/310075
Rather than writing a SQL query in raw text and calling a helper function to execute the query, you can create a "query" object, call methods on it to add fields, filters, sorts, and other query elements, then call the query object's "execute" method.
Others
On my website PHP memory limit is 512Mb, 215Mb however should be ok for a production website.
Also why don't you enable APC logging?
Sometimes masive scripts could slow down your pages. in Performance, check your option: agregate CSS and JS file.
you might consider Drupal Pressflow over Drupal.
Boost up your website by installing Boost module: http://drupal.org/project/boost
Cache your Views
Other advanced techniques could include:
Cacherouter ( a module that replace the default Drupal cache). Using Elysia Cron to reduce cron impact
Eventually switch to a superior hosting package or change your hosting provider
Regards...
Drupal site performance is obvious slow, but if its slow to a extreme level then you can go with other options that improved its performance.
1) You can install the memcache module on server,that is very fast in terms of site caching. Refer: How to install memcache
2) Change the PHP ini settings or mysql conf.
3) Check the custom modules if have, because execution of frequent queries create deadlock.
4) Check the mysql table storage engine & I will recommend the InnoDB which will provide row level locking.
精彩评论