Post by kickweb » Thu Jun 25, 2015 6:50 am

Hey Guys,

Been working on a store that presently has just over 46,000 products in about 30 categories.

I'm having some issues with page not found errors in the admin end. Mostly error log and geozones.

Server is a VPS - 2 Cores, 4Gb RAM, 80Gb HDD.

SEO URLS are enabled and I've checked and checked htaccess and vqmod and all looks ok and also had an OC dev friend look too. He believes server requires more grunt!!!

When I add the Geozones in for Mainland UK (excluding hard to deliver areas) I get page not found error when I have around 30 entries in that zone or more.

Been stuck on this for a few days and have googled, read the forums and asked for help and still stumped.

Any help would be appreciated.

Thanks

Newbie

Posts

Joined
Sun Apr 19, 2015 3:06 am

Post by Dhaupin » Fri Jun 26, 2015 12:31 am

You don't need more grunt, that VPS should be fine to run OC with that many products, assuming you aren't getting multiple thousands of requests a minute. You should do some optimizations though since OC is quite DB heavy. You should also consider CloudLinux to limit/throttle the store account as to not suck all resources and cause server faults. The following suggestions are assuming you use cPanel with WHM, but you can do most of them too using ol' fashioned SSH. Here are suggestions in random order :)



Turn off category counts in menus and stuff (found in store settings). Completely disable the model calls for it. This is an example for OC 1.5.x - http://www.opencart.com/index.php?route ... n_id=10999



Get your DB indexes situated. OC is very big queries that are quite slow. This is an example fixing tables for OC 1.5.x - http://bloke.org/php/opencart-is-slow-w ... mment-3993



You also should make sure your php.ini has the right kind of limits, just to be safe. These are found in /store/ and /store/admin/

Code: Select all

date.timezone = 'America/New_York'
magic_quotes_gpc = Off
register_globals = Off
default_charset	= UTF-8
memory_limit = 256M
max_execution_time = 120
max_input_time = 60
upload_max_filesize = 20M
safe_mode = Off
mysql.connect_timeout = 90
session.use_cookies = On
session.use_trans_sid = Off
session.gc_maxlifetime = 172800
allow_url_fopen = on
max_input_vars = 12000


Make sure that your limits are set correctly to handle enough connects (its found in WHM under apache configuration). You should be able to leave these default if its a templated VPS clone: Maximum Spare Servers, Server Limit, Max Clients, Max Keep-Alive Requests. But you may have to boost this one to 2000 if it still uses 1000 default -> Max Requests Per Child



If you do use CloudLinux (highly recommended) you should set some limits for the account running OC. In WHM nav to CloudLinux LVE manager and then hit the settings tab. Recommended minimums for the account:
- Speed - 140% (thats 60% of the total CPU in a dual core)
- VMEM - 1536mb
- PMEM - 1536mb
- EP - 50 (do not use less than 50 or you will see faults, especially if you have non cached feeds/sitemaps or dont use pigz and do large dumps)
- NPROC - 100 (rule of thumb, make them about double the EP for OC)
- I/O - 1024kbps (relates to pagcaching disk writes. This is the minimum....the speed depends on if drive is SSD...you can test real time throughput using 'iotop' in SSH)



While you're at it, set gzip (under WHM tweak settings > compression). Optionally you can turn on pigz for less CPU load while making things like sql dump archives or other types of backups. Gzip should be set around level 6. Pigz settings are your discretion. The lower the better, since DB will be getting hammered with CPU use.



Might as well edit the cPanel packages too, there is a bunch of crap that you will never use and you may want to enable addon domains for multistore use. Find the package manager, edit the default package (or whatever one you use). Turn off CGI access and set "max addon domains" and "max subdomains" to unlimited. Take note of the feature list used in this package.



Now find the feature manager. You have 2 choices when trimming out features - edit the feature list and remove them, or remove them globally with the "disabled" feature list. I opt for choice 2. Edit the "disabled" list and remove (uncheck) the following. This is for security too.
- Advanced Guestbook
- Agora Shopping Cart
- CGI Center
- Change Language
- BoxTrapper Spam Trap (unless you really need the filtering)
- Change Style (unless you really need the cPanel themes....)
- Counter
- Custom Error Pages
- Entropy Banner
- Entropy Search
- Getting Started Wizard
- Image Manager
- Install Perl Modules
- Install Ruby Modules (unless you really need Ruby and dont want to use SSH)
- Java Clock
- Java Countdown
- Mailman List Manager
- Network Tools (just use network-tools.com or SSH)
- Parked Domain Manager
- PhpPgAdmin (manages Postgre similar to PhpMyAdmin)
- PostgreSQL (unless you need it)
- Random HTML Generator
- Ruby on Rails (unless you need it)
- Simple CGI Wrapper
- Simple Guestbook
- Site Software
- Video Tutorials
- Web Disk (unless you prefer DAV)
- Webmail (unless you use a client on the server....Gmail is recommended instead in that case)
- Webprotect
Some other stuff you can disable is the bandwidth logging or various other forms of extra traffic logging, leaving just 1 instead of multiple ones running daemons.



Then, acquire page caching ability (you dont need an expensive mod for this). https://github.com/budgetneon/pagecache Note the issue about cache clearing on save, there is a vQ snippet to solve this at the bottom of https://github.com/budgetneon/pagecache/issues/14



Now you should also turn on caching in htaccess to further reduce requests. Put this after the rewrite engine turns on:

Code: Select all

### Caching - Turn on Expires and Set Default to 0
ExpiresActive On
ExpiresDefault A0

### Caching JS Files - 1 week
<FilesMatch "\.(js)$">
 ExpiresDefault A604800
 Header append Cache-Control "proxy-revalidate"
 SetOutputFilter DEFLATE
</FilesMatch>

### Caching CSS Files - 1 week
<FilesMatch "\.(css)$">
 ExpiresDefault A604800
 Header append Cache-Control "proxy-revalidate"
 SetOutputFilter DEFLATE
</FilesMatch>

### Caching Static Files - 1 week
<FilesMatch "\.(txt|html|htm)$">
 ExpiresDefault A604800
 Header append Cache-Control "proxy-revalidate"
 SetOutputFilter DEFLATE
</FilesMatch>

### Caching Image Files - 1 Month
<FilesMatch "\.(gif|jpg|jpeg|png|swf)$">
 ExpiresDefault A2592000
 Header append Cache-Control "public"
</FilesMatch>

### Caching Media Files - 1 Month
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
 ExpiresDefault A2592000
 Header append Cache-Control "public"
</FilesMatch>

### No-Cache Dynamic Files
<FilesMatch "\.(php|xml|cgi|pl)$">
 ExpiresActive Off
 Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
 Header set Pragma "no-cache"
</FilesMatch>


After about a week, or after some decent traffic, check your DB via PhpMyAdmin "status" tab. It may have suggestions for you regarding performance. Clicking the issue will pop up some suggestions to make things work a little more smooth. Also, keep checking in on your CloudLinux stats. These are found in the domain cPanel manager under "resource usage". Look for memory/vmem and EP spikes. CPU and I/O will spike alot, but they wont server fault you. If you are noticing EP spikes, go back to LVE settings and increase it. If its still happening, find the script that is taking too long to execute (such as a feed). If its vmem spikes, it could be related to things like image cache generation or other types of util processes such as crons or syncs.

Attachments

stats.png

some examples of load on team managed store - 5 domains, 20,000 products, 400 categories - stats.png (509.13 KiB) Viewed 8492 times


https://creadev.org | support@creadev.org - Opencart Extensions, Integrations, & Development. Made in the USA.


User avatar
Active Member

Posts

Joined
Tue May 13, 2014 3:45 am
Location - PA
Who is online

Users browsing this forum: No registered users and 178 guests