I got a VPS with the following specs:CPU: 4 coresRAM: 8192 MBHarddisk: 300 GB

I got direct admin installed on it (VPS Came with it) and I uploaded a site to it .. so far so good!

now the problem im facing is that the webserver is extremly slow, The website takes ages to load (www.ictaanbieding.nl)I tested it on http://www.webpagetest.org and Everything seems fine exept for First Byte Time

I have no idea what to do here, I hope you guys can help me out ! :injured:

cpradio
—
2014-01-14T16:35:04Z —
#2

First thing I'd personally do, is rule out any programming. Place a static simple page as your index.html or whatever your default loading page is, and run your test again. If it still takes forever and a day, then you know it is a network/server setup issue. If it takes a split second and gives you an A, then you know you need to look internally at the application/program that runs your site. Maybe it is your database connection (for example), or a poorly written section of code.

ICTaanbieding
—
2014-01-14T17:01:56Z —
#3

cpradio said:

First thing I'd personally do, is rule out any programming. Place a static simple page as your index.html or whatever your default loading page is, and run your test again. If it still takes forever and a day, then you know it is a network/server setup issue. If it takes a split second and gives you an A, then you know you need to look internally at the application/program that runs your site. Maybe it is your database connection (for example), or a poorly written section of code.

Damn, yes ofc thats a good way to test it, tested this, added a simple test index.html and no delay at all. ran the test again and it got an AIts a start but whats next?!

cpradio
—
2014-01-14T17:07:41Z —
#4

So now you know it isn't the server setup/configuration, but now something that is internal.

Is your database and apache setup on the same VPS or are they separate entities?

ICTaanbieding
—
2014-01-14T17:12:06Z —
#5

both on the same VPS,

Im running a simple opencart webshop with 8000 products, and all of them got a image (I thought that might be the issue) but even with image compression its slow

cpradio
—
2014-01-14T17:14:40Z —
#6

Are you using localhost as your connection string for your database? Or are you using a DNS entry? If a DNS entry, do you have a entry in your /etc/hosts file that indicates the DNS entry should be pointed to 127.0.0.1 (since they are on the same machine)?

Please note, don't point your domain name to 127.0.0.1 unless you want your site to be unreachable. If you are using mysql.domainname.com then I'd have that in your /etc/hosts file pointing to 127.0.0.1 (unless you need outside resources hitting it). If you need outside resources hitting it, using localhost to connect to your database.

ICTaanbieding
—
2014-01-14T17:15:49Z —
#7

its set to localhost

edit: would there be a benefit to point it to a dns ?

cpradio
—
2014-01-14T17:27:37Z —
#8

okay, now to start to rule out your opencart queries.I'd ensure slow_query_log is enabled, access your homepage and then execute mysqldumpslow to review if any of the queries are not performing very well.

If that all looks good, I'd turn my attention to any third party sites your site may be accessing, as they may be slowing it down.

ICTaanbieding
—
2014-01-14T17:47:46Z —
#9

slow_query_log is enabled, the logfile is empty, I dont understand how to execute mysqldumpslow to review it

When I try this in putty I get: (just by giving the command: mysqldumpslow Can't determine basedir from 'my_print_defaults mysqld' output: --bind-address=127.0.0.1

When I use the command: mysqldumpslow /home/admin/domains/ictaanbieding.nl/public_htmlIts telling me its reading mysql slow query log from /home/admin/domains/ictaanbieding.nl/public_html

I fixed it or atleast made it load a lot faster (it was 20 seconds) its 1.834s now wich is still a big FFound a xml file, made a backup of it and deleted it as it wasnt a original opencart file. after this it speeded up!

cpradio
—
2014-01-14T18:54:35Z —
#12

ICTaanbieding said:

I fixed it or atleast made it load a lot faster (it was 20 seconds) its 1.834s now wich is still a big FFound a xml file, made a backup of it and deleted it as it wasnt a original opencart file. after this it speeded up!

Interesting... was the XML file being read by opencart?

cheesedude
—
2014-01-14T19:01:42Z —
#13

ICTaanbieding said:

but even with image compression its slow

Image compression? Images are already compressed. You are not attempting to compress them again, are you? I didn't see any evidence of that, but I have to ask.

Your main page has 50 requests. That is a lot, but not the root of the problem. tools.pingdom.com indicates the wait time to receive the HTML of your index page is over 20 seconds. :eek: That's some of the worst performance I have ever seen outside of a shared host I used years ago. On the first load, all of your files took a long time to be transmitted, including the images, CSS, and JS. On secondary loads, the HTML still took over 20 seconds to be received but the linked in files took less time. That seems to indicate the bottleneck is in the page generation somewhere.

Are you running any type of PHP accelerator? It looks like you are using PHP 5.3 which was released in 2009 and for which support will end in July 2014. You should consider upgrading to PHP 5.5 if your code will allow it. Significant improvements in performance have been made since 5.3. Plus, 5.5 has an available opcode cache that can help improve performance. But I don't think that will help in your situation.

For now you must simplify. Turn off output compression for starters and any other special, non-essential configuration features. If that doesn't help, you will have to start profiling your code and database queries to find where the trouble is. You have a powerful VPS. No way should it take this long to load a page.

Right after I posted this I saw the original poster's reply and tested his site again. The main HTML load time has declined from 20 seconds down to 0.723 seconds. I think the OP fixed it.

cpradio
—
2014-01-14T19:04:54Z —
#14

cheesedude said:

Your main page has 50 requests. That is a lot, but not the root of the problem. tools.pingdom.com indicates the wait time to receive the HTML of your index page is over 20 seconds. :eek: That's some of the worst performance I have ever seen outside of a shared host I used years ago. On the first load, all of your files took a long time to be transmitted, including the images, CSS, and JS. On secondary loads, the HTML still took over 20 seconds to be received but the linked in files took less time. That seems to indicate the bottleneck is in the page generation somewhere.

Hehe, I think you missed a post or two He found the bulk of his time due to an XML file, once that was removed, it dropped to a 1 second load time However, there is still the 50+ requests being loaded, and that may be the issue at hand now. There is also the 404 on the favicon.ico that will add time as well. Just create a blank favicon.ico (if you don't have one already, so you can get rid of the 404).

ICTaanbieding
—
2014-01-14T19:06:58Z —
#15

Yes it was doing something with my images, and I got 10K images so I think that just caused it to overload.its fixed now, so thats great haha thanks for your help!

cheesedude
—
2014-01-14T19:09:34Z —
#16

ICTaanbieding said:

Yes it was doing something with my images, and I got 10K images so I think that just caused it to overload.its fixed now, so thats great haha thanks for your help!

You should still consider upgrading from PHP 5.3.

cpradio
—
2014-01-14T19:10:39Z —
#17

cheesedude said:

You should still consider upgrading from PHP 5.3.

I'll second that. I don't think it will make a huge difference in the loading of your site, but you'll be better protected from known vulnerabilities.

ICTaanbieding
—
2014-01-14T20:13:40Z —
#18

cpradio said:

I'll second that. I don't think it will make a huge difference in the loading of your site, but you'll be better protected from known vulnerabilities.

true but tbh im a bit scared to upgrade, Im not that experienced and dont wanna mess things up haha. if I email you root details will ya do it ? haha