Why would an Apache Server timeout on first httpd request? - wordpress

I have an odd issue with my Apache Server. Almost every single time the server gets a timeout on the httpd first request, and then I hit reload and the page loads right up. What could possibly cause this?
I looked into the server errors, there is nothing except that wdaemon is not running. I looked into top and everything looks fine. I checked on GTmetrix and it also gets timeout on first request! And when GTmetrix returns the stats nothing looks out of the ordinary.
The httpd requests a WordPress project, using a 3rd party plugin (P3 Plugin Profiler) I analyze the active plugin response and it also looks fine, average.
I appreciate any help!

Well, well, well... StackOverflow has some powerfull magic! Everytime I take the time to ask question, I seem to figure out the answer right after it. Feel free to delete this question, if any moderator feels like so.
Anyway, the problem indeed was internal, not server related. After analyzing with more caution I noticed a plugin was taking too long to load so I disabled it and it made all the difference. Funny thing about it, it is the only plugin I actually had to pay for.
Anyway, thanks SO!

Could be all sorts of things. WordPress can be a nightmare for performance - usually as a result of too many, badly written plugins. But the first place to check is your PHP opcode cache how you interest the data depends on which opcode cache you are using - APC is a very different beast from then zend cache. You didn't say which applies here, but even describing just one goes way beyond what's practical here. If you have any plugins, you should have listed them in your question. Try disabling them all and see if the problem persists. Then start adding them back one at a time till the problem recurs.
If you think you have sufficient understanding of the profiler to make a diagnosis why did you tell us about it? If your not an expert in profiling WordPress why didn't you include the output of the profiler in your question?

Related

Wordpress W3 Cache is over cacheing -- and dont know how to approach the problem

I created an LMS, where teachers approve students to view certain lessons, using the Educator plugin which is no longer available. I had never installed a Cache plugin cause I know nothing of it, but time performance led me to W3 and a tutorial on recommended.
Now, I am getting people unable to see their course work even when logged in. Meaning, they cannot access a blog post that is blocked by default to all users but them. I have the option of "dont cache for logged in users" checked.
Here's where I am at a loss: People in the same course can see the post... and i can always see it myself. Sometimes the person reloads and it works. And since I am just a 3rd party, I don't have names/emails of people with the issue. So I have no idea what they see, how they see it, and how to debug.
So, after this block of text, here's my hypothesis and what I need help with:
Hypothesis: Everything is blocked by default, thus a person who is re-entering after W3 was installed needs to basically wait for his browser-server to agree on what he can see again.
If this is wrong cause I know nothing of cacheing... how do I approach this? re-install and start adding cache options one by one, waiting a few days to see if any student has issues?
Sorry if this is not too technical a question, I just need that first clue to get started :)
you need to check the .htaccess file. most likely cache code has been added to this file. that's why you have problems with the cache.

wordpress menu includes different domain randomly

I'm using Wordpress 4.9.1–en_GB, and have a live site which has been up and live for some months without issue.
48 hours ago it suddenly (or rather I noticed suddenly) started displaying some pages as unformatted (no css) lists of links and text. The links on those pages were to another domain which directed to my site, but which has never been part of my site, and for which there is no direction within the site.
Loading and saving that one page fixed it on that page, and another page which was exhibiting the issue.
I redirected the external domain so that it would not point to my website.
Today it has exhibited the same behaviour, but with a subdomain which points to my site, but which again is not in use. Again saving the page without making any edits 'fixed' the behaviour.
I'm not asking for a fix - but whether anyone has ever experienced a similar problem, or has a pointer towards where to look, and will report back what I find, in the hope it helps someone else if it ever occurs to them.
I didn't originally build the site - it has a load of plugins, not all active and disabling and removing plugins is definitely an option - but not a great one, since the problem is not predictable, so I have no firm way of knowing whether my actions have fixed the issue, and in the meantime my commercial site will not be functioning as desired (which I appreciate is occasionally the case anyway it would seem).
It sits in Amazon EC2.
sorry for the lack of precision, but I am truly stumped.
this sounds like your website may have been breached. to address the conflict of web pages not formatting is usually the ssl not being installed correctly on the server. but if you have a lot of plugins installed it's a huge security issue and the plugins may be causing the domain issue
the plugins may be causing a conflict within each other I would recommend removing the plugins that generally don't get used.
deactivate the plugins in use and reactivate them.
use word fence security plugin to run to a scan on your website.
when I had this problem it was because the ssl was not installed on my server correctly if not that, a breach may be the cause. I hope this helps.
If the issue started within that time frame as stated that makes me more confident that this is an ssl issue. Sometimes an ssl doesn’t install correctly on a server this can cause a conflict with how the layout in css and HTML is affected. this is common in some cases, while it’s happening with the current theme your using, some WordPress themes can bypass the ssl error, I would recommend getting a new ssl from let’s encrypt and removing the one that was auto renewed through let’s encrypt. This could simply fix the problem. If not feel free to share your findings on the issue.

Very Slow Wordpress Performance after moving to VPS?

We are struggling with the speed on our wordpress website. Have just moved to a VPS and this hasn't helped the speed at all.
Can anyone offer any recommendations on what needs to be done?
link to the website >> salon99.co.uk
You have some javascript errors, looks like not loading properly. How much ram your vps have, thats other issue might be. Avoid 404 on resources (images, css, js)
Check some tips from here
http://tecadmin.net/security-tips-for-lamp-stack-on-linux/
https://askubuntu.com/questions/60298/how-do-i-properly-set-up-and-secure-a-production-lamp-server
https://www.digitalocean.com/community/tutorials/building-for-production-web-applications-deploying
Provide more information on your setup.
Try install Google PageSpeed and test your site here
https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fsalon99.co.uk%2F&tab=mobile
Running your site through Pingdom shows a 4 second time to first byte. This suggests you main issue is definitely server side. There's a couple of diagnosis plugins that you can install which will reveal which plugins may be slowing things down*, and which DB queries are expensive:
Query Monitor
Debug Bar
P3
Once you've worked out where the slow downs are coming from, you'll be in a better position to solve them. You might find you have one query in particular that is especially slow.
* I've always found WooCommerce to be on the sluggish side, but them's the breaks.

Where did utils.php come from, TinyMCE hack

Last Wednesday a variety of the WordPress sites I manage got hacked, they were infected with a Viagra link (malware is so original).
I noticed in the wp-includes directory a file called utils.php (wp-includes/js/tinymce/utils/utils.php), also an addition to my general-template.php for the get_footer function.
This hack seems to only affect Google search results for sites, not the site when directly viewed by entering the URL, i.e your cached site will show a malware infested mess and lose ranking, meanwhile you will wonder why due to the site looking fine when viewed.
My host (TSO Host) have cleaned up the sites, didn't even need to ask, but I have no idea how the infection got there in the first place.
So my question is, does anyone know how the breach happens and what I can do to prevent it, other than the usual security tips?
This happened to a site that I spent weeks cleaning up. I can give you a few pointers:
Go through the Wordpress core files (under wp-admin and wp-includes) and delete all files that you don't see in the default wordpress instillation. I've never seen a plugin create a file in one of those 2 directories. After this, it'd be a good idea to re-install Wordpress, just in case they changed any of the existing files.
After that, change your Wordpress/FTP/SSH passwords as they've likly been cracked. Install WP Better Security. It seems a little annoying at first, but you can monitor everything with it, change the login slug, remove version info hackers can use to find security holes, black-list known hackers, and so much more.
Finally, this last one will take some time. Google your theme and each one of your plugins, and see if Wordpress has stopped using them because they were a security vulnerability. You'd be surprised at how many plugins haves holes. Try to avoid really new plugins, and try to use the same plugin for as many different sites as you can. If you're hosting more than one site on the same server and one of the sites gets hacked, they're all hacked.
It sounds like a pain, and it is a little bit, but after you're done you'll feel so much better knowing that you're in control of everything. Trust me.

Drupal 6 website is very slow

I've made this website for someone a while ago, using Drupal 6. The problem is that it's getting incredibly slow... When I optimize the database it seems to go faster for a while and then it's slow again... I tried almost everything that I found on Google, and nothing seems to work. Maybe someone here knows a bit more than Google? :p
One thing I noticed using PageSpeed, is that some of your images on this page (http://heuvelfolies.be/CMS/Producten) are resized using HTML and CSS, rather than displaying thumbnails. Not related to your db issues, but overall it will help with page loading.
Example output:
http://heuvelfolies.be/img/Producten_Netten.jpg is resized in HTML or CSS from 360x360 to 100x100. Serving a scaled image could save 74.7KiB (92% reduction)
Are you using other caching techniques such as Memcached? Drupal caching would be step one, which you mentioned you did, but the next step would be an intermediate caching system. I've had great luck with it.
UPDATE: Doesn't look like your host provides VPS so this would be something to do if you ever moved to a VPS. Having said that, being on a shared server has its limitations. Not knowing what the "other guys" on the server are running that may be slowing the whole thing down, is one of those limitations.
Are you using Drupal's built-in caching?
If not, turn it on -- it can make a big difference.
You may also want to look into a server-based caching solution such as Varnish.
What modules are you using?
It's possible that you're using a module with known issues. Google for speed problems related to the various modules you're using.
Are you displaying any dynamic content on every page?
This can slow things down, as dynamic pages can't be cached. Consider using AHAH or AJAX to load the dynamic parts of the page via Javascript after page load, so they are separated from the main page content, which you can then cache properly.
I can't event ping that server. Maybe you should consider changing a hosting?
Other things worth checking are cache enabled, JS and CSS file merging enabled. If layout consists of many graphics, consider using CSS sprite. Also make sure that connection to your DB is fast.
Before trying to improve anything, check the "Recent Log Entries" on the admin page.
There are so many reasons for a site being slow, first try to make sure that there's no errors.
I've just had a look at your site, it wasn't particularly slow, nor fast. Pages didn't seem to hang but thumbnails were not loading so quickly.
Check your site's health, check your hosting provider, look into caching, for solutions like Varnish, you will need Pressflow or Drupal 7 as well as root access, meaning at least a VPS...

Resources