Articles of server load

server load. $_SERVER and $_SERVER

while writing new code and testing it, I incorporate it into my site by testing for the remote IP address as follows; i.e., I’m the only one who will see the new code: in /functions.php: // to hide certain sections/features from people other than myself $myIP = ‘219.88.88.88’; // the value as currently indicated by […]

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 […]

What is the best way to count and display the number of posts?

I have a section in my site where I display the 10 most popular posts. Now, I want to display a number, from 1 to 10, besides each post. Like this: Top 10 posts post a post b post c and so on… I implemented a counter inside the while loop. I initialized the counter […]

How to Better Control WordPress Cron Jobs?

I have a bunch of standalone WordPress sites, and WordPress Multisite Network of Sites on my server. There are times where there are too many sites all running cron jobs too soon in proximity. I am looking to better control when cron jobs are triggered on each WordPress website. Is it possible to disable WordPress […]

Load testing for WordPress functionality

Does anyone know of (or have) any scripts / processes they use for testing performance under load – especially of WordPress specific behaviours, like posting many comments nearly simultaneously, while under heavy simulated traffic. I typically use apachebench to test general performance (and to make sure caching is working), but I can’t see a way […]

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 […]

Meta_query with relation 'OR' killing server CPU

function get_nb_offres( $typeOffre ) { global $type_bien_correspondances; $args = array( ‘post_type’ => ‘annonces’, ‘meta_query’ => array( ‘relation’ => ‘OR’ ) ); foreach( $type_bien_correspondances[$typeOffre] as $typeBien ) { $args[‘meta_query’][] = array( ‘key’ => ‘type_de_bien’, ‘value’ => $typeBien ); } $annonces = new WP_Query( $args ); return $annonces->post_count; } My global $type_bien_correspondances is here : $type_bien_correspondances = […]

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. […]

Too many MySQL connections on WordPress

I installed WordPress on my Ubuntu server. I only have 3 blog posts but it reaches max_connection within an hour. So whenever a user visits my blog it shows a database establish error. My log file has the following entry: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting [Mon Jun 20 06:30:21.877663 2016] [mpm_prefork:notice] […]

Extra themes – ok or bad?

I know I am a newbie here, but I’m just wondering, if you keep extra themes in your WordPress setup, will it add bloat to your site? Can these other themes provide a security risk even if they aren’t activated? I imagine it’s best to delete any theme that aren’t in use, but I’m noticing […]