How to optimize 'select found_rows()' query? Several 'high load average' alerts daily

I have 5,000 regular posts, 6,000 posts in one post type and 2,000 posts in another post type. Needless to say, that has made the wp_posts table quite large. Not to mention, I have custom taxonomies set up to mimic the post types so for every Company A entered into Company post type, there is Company A, I manually entered Company A into Company taxonomy. That way, when I do a regular post about Company A, I can effectively tag …
Category: Web

Mysql / WordPress killing my server with 80k users

I have recently installed wordpress in a production server with 80K fields in wp_users registered, 175K fields in wp_post table and 350K fields in wp_postmeta. Problem is that mysql database is consuming all CPU and getting server too slow. I disabled all plugings and renamed those plugins folders and problem persists. top - 20:26:55 up 6 days, 16:01, 1 user, load average: 4.42, 4.47, 4.54 Tasks: 192 total, 2 running, 190 sleeping, 0 stopped, 0 zombie %Cpu(s): 55.2 us, 3.4 …
Category: Web

Profiling a WordPress Website for Deployment on Shared Hosting?

I am having a problem with CPU usage on my website, and am looking for a way to detect (and fix) what is causing it. A topic not covered in this question. Following on Hakre answer here, I now realize that what I need to do is profile my PHP calling. Is it reasonable to put the website on my own computer, run the profiler, and use that information to improve my website? Any other suggestions on how to do …
Category: Web

Checking for new message using AJAX and PHP. Server overload?

I wrote a script (it may not be perfect, I'm newbie) to check for new message (using ArrowChat and Buddypress) every X mins. It works good, but I'm worried will it overload my server? It's shared. Code: PHP // Prepare database global $wpdb; $wpdb->prepare; // Check are there new messages $query = $wpdb->get_results( 'SELECT `id` FROM `arrowchat` WHERE `to` = "'.$_GET["user_id"].'" AND `user_read` = "0" AND `read` = "0"'); // Count messages $x = 0; foreach( $query as $msg ) …
Category: Web

Are there server performance benefits to fetching only specific fields when querying the REST API?

I understand that having less data being downloaded improves the experience to the end user, but my question is related to the actual server performance, would the response be faster? I am fetching posts like this: https://example.com/wp-json/wp/v2/posts?_embed&per_page=20&categories=9 It returns a fairly large object for each post, but I only need the id, title, excerpt, featured image and permalink. Would adding _fields[]=id&_fields[]=title, etc... to the above url improve server performance?
Category: Web

What are best practices for configuring a server for WordPress sites?

I hired a sysadmin to set up a VPS server for me and, unfortunately, it looks like things were not set up correctly. When trying to install and update plugins, I run into permissions errors all the time. WP Super Cache is the main issue as it causing my readers to run into 502 errors. Currently, my site does not load pagination (no Page 2, Page 3, etc..). 12/1 Update: The apache server has restarted itself multiple times today and …
Category: Web

Update, add, remove plugins, themes or wordpress behind load balancer

I am running wordpress on two identical servers. Both sit behind a load balancer. Both use the same database. How am I supposed to do things like update a plugin or wordpress? My current thought is to: Disconnect one of the servers from the LB - So I know which one I'm working with. Perform necessary change (eg: update plugin) via dashboard. Copy necessary directory from the active server (eg: plugins/some_plugin) and replace that file on the inactive server. (Since …
Category: Web

Site load time increased

My WordPress site(urchd.com) load time increased and sometimes I face error 524 due to some queries execution time exceeds 21 seconds. I already tried contacting my hosting provider they say that you need to optimize the queries and reduce the load on the server. Can anyone guide me on how can I resolve this?
Category: Web

Site not responding error - taking long to load

I have a wordpress website which gets around 20K visits a days and with around 7pages/visit and 62 hits per visit. My server is : 8 processors --> Intel(R) Xeon(R) CPU E5405 @ 2.00GHz 8 GB RAM Now my users are complaining about that the site takes time to load sometimes and craches giving the taking too long to load and it also happened to me a couple of times wher i thought it was my connection. From previous issues …
Category: Web

Should I store critical css in the database or in my theme's filesystem?

I have a method for detecting a post's critical css when the page is requested and in-lining it to optimize page speed. I would like to cache this css to avoid having to compile it for every page request. I am using file_get_contents on multiple css files to concatenate the css and I've been told this means a lot of read operations in the file system per request and it isn't optimal for server load. I am trying to decide …
Category: Web

Large Number of Wordpress Posts

I am in process of setting up a catalog website and it has some 1.5 Lac products. I will write some script to import all the products but I am not sure whether WordPress will be able to handle such a large amount of posts. Have any one imported so many posts in WordPress and how much is the degrade in the performance of the website. And any solutions to fix that performance. Can any one suggest any other CMS …
Category: Web

how to restore a wordpress website, when hosting has got expired but the hosting company gives you a bunches of zip file?

I am having a premium wordpress theme which was hosted in godaddy, but its hosting got expired. I somehow managed to get all the previous files from godaddy by paying a hefty amount of money. but i don't know how to restore my site. currently it is showing "error establishing a database connection". what can be done?
Category: Web

Server technical information and first respond time for WordPress

I made a wordpress theme, when I compare mine with another website (similar) mine is smaller Page size 1.1 MB Load time 5.05 s Requests 99 but their website is Page size 1.4 MB Requests 132 Load time 2.78 s my question is, how server types affect load time? because mine take about 3 seconds to reply, but their 171ms. what can I do as developer to reduce first respond time? https://tools.pingdom.com/#!/b4BQPa/http://www.healthvisionuk.com/ https://tools.pingdom.com/#!/chhrS3/https://www.helpinghandshomecare.co.uk/
Category: Web

Is it possible to cache ?wc-ajax=get_variation

I have been trying to figure out a way to make this work for awhile. I have a site, pizza shop. It has a promo, two pizzas. The product is any 2 or 15 types of pizza. I have the 15 types of pizzas set up as two separate variations, first pizza and second pizza. I have w3tc setup and working well. I have engintron running and cloudflare free tier. I have DB and objects set up to cache, but …
Category: Web

Server peek by Own-IP-Calls?

My site did not load a few times in the past day so I contacted my webhost and asked for a reason - their answer revealed, that Own-IP-Calls were the reason for the increased traffic. As far as I know, Wordpress always links to images and internal links via absolute links. Is that a common problem? Are there any fixes despite using a cdn?
Category: Web

Too many posts cause slow load when paginating

I have about 10k posts and I made a page that lists all posts but it is paginated every 54posts. It gives 131 queries in 6.730 seconds which is pretty slow to load. Is there a way to make it load faster? This is my functions page <?php /* Custom code goes below this line. */ add_theme_support( 'post-formats', array( 'aside', 'gallery' ) ); add_filter( 'use_default_gallery_style', '__return_false' ); /* Add the Javascript */ $path = get_stylesheet_directory_uri() .'/js/'; wp_enqueue_script('post-navigation', $path.'jquery.navigate.js', array('jquery')); function …
Category: Web

How do I add indexes to Wordpress Database?

I got a message from Hostgator about my account being suspended because of the load it put on their servers. This is about the fifth time this has happened. I am on a shared server. And they said it could be resolved by simply adding new indexes to the database or optimizing the database using other techniques. I have been using SQL queries and the "optimize" option in phpMyAdmin to optimize my database but that hasn't helped. I have also …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.