Media wiki randomly cannot access the database - mediawiki

I have media wiki running on a VPS with 256mb ram. From time to time I get the follow page
Sorry! This site is experiencing technical difficulties.
Try waiting a few minutes and reloading.
(Cannot access the database: Connection refused (localhost))
Would this be because of low ram? I turned on php error reporting in .htaccess but dont get any further info.

I upgraded my ram from 256 to 768 on the VPS and do not have the error anymore.

Related

MySQL / Web Server Bottleneck

I’m trying to determine a MySQL / Web server bottleneck.
I have three servers. A Web server running Nginx, a remote MySQL server with my Wordpress DB and another remote MySQL server storing our data.
The bottleneck I’m trying to find is between my second MySQL server storing our data and my Web server.
We have a page that has three DataTables on it (three separate queries). It’s loading very slowly, if it does all. Occasionally I’ll get a gateway time out error.
I don’t think the queries themselves are the issue. From DataGrip all three average between 200-500ms. Currently the queries aren’t indexed as I’ve been told the plugin cannot take advantage of indexes, but I might try anyways.
Hardware and Setup:
My MySQL server is an AWS R6G.Large, 2 cores and 16gb ram, SSD of 150 IOPS and 128 MB throughput. innodb_page_size is 32, buffer_pool_size is 11000M, innodb_buffer_pool_instances is 10 and innodb_log_file_size is 1G
Web server is an AWS C6G.Xlarge, 4 cores and 8gb ram, SSD of 150 IOPS and 128 MB throughput. Uses FPM and Opcache.
I’ve tried monitoring using TOP on both servers, but to be honest I’m not sure I have knowledge to properly utilize the information.
I’d really like to determine if it’s hardware or software, somehow, and if it’s hardware is there a way to isolate? I have no problem increasing hardware if that’s actually the problem.
I’m not sure if this is allowed on Stack, but I figure it might be easier to know what’s going on if I record my screen with TOP running on both servers. I added a video to my public Google Drive. The video has both my MySQL server (on the top) and Web server (Nginx, on the bottom). What I did was load the page (3sec mark in video) and recorded the outcome. The video is 1:05, which how long it took for the last table to appear. The video was recorded while my site was in maintenance, so no other IP / traffic could reach either server.
My google drive link:
https://drive.google.com/drive/folders/1NtdE1Z4875i1Xx2Wy2EXGgknt9yuY1IN?usp=sharing
Hopefully someone can help.
Aimee

Error Establishing Connection if there are multiple users using the site

We have a ASP.NET application deployed internally and it is being used by almost 500 users. There are instances that when a lot of users are using the site, there's an error connection.
We have tried several options like pooling, optimizing our code, but we still don't know if this has something to do with the server. Right now, we are using shared hosting (dedicated 1.5 gb ram). Do you think upgrading the server will resolve this issue?
Also, is database computation dependent on ram and # of cores?
Thanks!

Wordpress site -- Error connecting to database - only on high traffic

I have a wordpress 3.5.1 site that's getting a little bit of traffic (80 concurrent visitors, ~5 clicks/pageviews per second). The site runs fine until it spikes to ~85 visitors. There are usually 4 admins logged in at the same time. The site has 8 custom post types--Posts has 3500 posts, and Press Releases (a custom post type) has 13000 posts. All of this is paginated on the site, so there are never more than 20 posts showing on any one page.
The only plugins I'm using are wp-pagenavi and w3totalcache.
I set WP_DEBUG_LOG to true and logged the errors. The main error I'm getting (besides various notices and warnings unrelated to this issue) is mysql has reached the max_user_connections limit.
My current max_user_connections is set to 75. I tried to set it higher, but the cpu can't handle the load (4 Quad Core CPUs at 2.17GHz each and 4GB of RAM).
What could be causing so many connections?
I've viewed the mysql processes running when the errors happened and there are many connections that say "SLEEPING" or "SLEEP" (probably 15-20). I also noticed via the process logs that httpd is restarting quite often during the peak traffic times.
Any ideas on how to resolve the issue?
NOTE: Please do not respond if your answer is to check my wp-config.php file and make sure my username, password, and host are correct. This is NOT the issue. The site works fine under normal traffic.
The database server is dropping out due to high loads. What's in the error logs? What's the size of the database? Have you used mysqltuner.pl to check the query load and caching settings for the MySQL server in my.cnf? https://github.com/rackerhacker/MySQLTuner-perl
WordPress can really bog down the database with many post/page revisions. Delete them with a plugin http://wordpress.org/extend/plugins/revision-control/ I've dropped databases to 10% of their original size with a resulting huge increase in performance.

MySQL database is loading very slow

I have a wordpress installation which has over 5000 posts in it. For the last few days, the database is loading very slowly. I have used the database optimization plugin as well as optimized db tables from back end. But still the issue exist. After I restart the MySQL server everything seems to work just fine. The same issue exists for my other website which is a Joomla installation on another server(Amazon) and has over 50,000 articles. Even here I regularly do database optimization but still the pages load very slowly. Sometimes to over 1 minute. There is page cache on both the sites, still I am getting this issue. There are other websites also running on the same server but they are relatively new and less content compared to these two sites, they load very fast. The problem is with these two websites only.
Check out:
Connection pool. Maybe you're running out of connections and get bottlenecked
Server's cache
slow queries audit
... this are just hints, to get real help you should indicate more system performance's info
I'm not sure about the Wordpress site configuration settings, but for Joomla, if you are not already running MySQLi, I would recommend enabling in in the Global Configuration. Try clearing the site cache and if you are running on Joomla 1.5, then if possible, upgrade to Joomla 2.5 as it is a little faster when running queries. In the end, it might just be due to the fact that you are on a shared host, so if you are willing to, a VPS server would speed things up.
There can be many reason for the same like : "Hosting Server Issue (use dedicated server for such sites)" , "Use good cache plugin availabe for joomla & wordpress" , "Use db optimize plugins"
You can also refer to following sites -
http://www.sparringmind.com/speed-up-wordpress/
http://wpmu.org/too-many-wordpress-plugins/
http://www.joomlaperformance.com/articles/performance/so_you_want_to_speed_up_joomla_3_14.html

AppHarbor MySql Yocto connection error

My AppHarbor Web Instance uses the free MySql Yocto 20 MB plan, off late I'm seeing "Unable to connect to any of the specified MySQL hosts". Is this because the database used up the free 20 MB or is MySql really down right now, I am not able to figure it out.
Is there any straight forward way of finding the curent database memory size that would be proportional to the plans published w.r.t MySql AddOn.
We've had problems with our MySQL service in connection with a big Amazon Web Services outage. The MySQL service should be restored now, at least to read-only mode. We're tracking the situation closely.
The error you're seeing is unlikely to be related to database size issues.