0

all. A have a site with folow structure

/somePage/:countryPage:/:regionPage:/:hotelPage:/

The type of all this page was 'page'. After adding more than 50k pages, memory usage of /wp-admin/ became more than 300 MB, and some pages are crashing (edit page on parent dropbox for example), though memory_limit is 512MB.

Aftrer problem investigation ( WP load ALL pages with type 'page' in the begining), I suppose to change type of :countryPage:(~100 pages), :regionPage:(~1000 pages) and :hotelPage:(~50000 pages) to some custom page type, leaving type of somePage 'page'

important to save site page structure.

I spend a lot of time in google, trying some variants, read a lot of posts, but I can not combine 3 diffrent custom page in one structer. The best result was correct get_permalink(), but 404 while opening.

THE QUESTIONS

  • Is it real to combine 2 or 3 diffrent custom page type in one permalink? How can I do it.
  • Is any other solution to decrease memory usage?

Thanks for help, sorry for my english.

  • The problem I see is not the amount of pages, it is the hirarchical relationship. I mean, the problem you describe will happen with any hierarchical post type, not only "pages". If you want to categorize by country/region, you may want to explore custom taxonomies and not pages or post types, it will be lot more faster. – cybmeta May 24 '18 at 14:26
  • As I guess, memory issues in hierarchical post types (like pages) is known: "With this parameter set to true WordPress will fetch all IDs of that particular post type on each administration page load for your post type". See the "hierarchical" section on codex.wordpress.org/Function_Reference/… – cybmeta May 24 '18 at 14:47
  • They sad "if you are planning to have very many entries (say - over 2-3 thousand)". So I should move :hotelPage: to custom page type. Ok. How can I save structure /somePage/:countryPage:/:regionPage:/:hotelPage:/ where /somePage/:countryPage:/:regionPage:/ is simple page and i have ~50k :hotelPage: – Tony Katano May 24 '18 at 15:50
  • If you move to another hierarchical post type ("page type" doesn't exist, "page" is a post type) you will have the same problem. The issue is not being a page or a post, it is the hierarchical relationship. As I said, I see country and region more like taxonomies than post typee, because you are using them to categorize the "hotel" post type. – cybmeta May 25 '18 at 9:13
0

1: Switch hosts

For this much content, you need a more powerful server. A shared server is unlikely to hold up with this much information in the database, so you need to look into a VPN, dedicated server, or possibly even a load-balanced setup. That partly also depends on how much traffic you are getting or expect to get - the more people using the site, the more the database is accessed.

2: Optimize database

A few things you can do are: turn off revisions and autosaves (and delete the ones that are already save); use a db optimizing plugin; and remove some of your plugins. Some plugins save a lot more information to the database than others - spend some time looking through your tables and find out where there's a lot of information stored, particularly if a plugin is saving a lot in wp_options. If you can remove or at least replace some of those plugins it will lighten the overall load on your database.

3: Cache everything

You should also experiment with various forms of caching, from plugins to server setup. This can help immensely by reducing the number of queries to the database.

4: Check your theme

Some themes are more data-intensive than others. Try a few different ones and also try a query optimization plugin to see what your theme (and plugins) are calling, and find ways to reduce the complexity and number of queries.

|improve this answer|||||
  • For public part I have ~40mb usage and very fast responce. Main problem - i can`t edit page in admin part – Tony Katano May 24 '18 at 14:08
  • 1
    It's still part of the server's job to host the admin area. Front-end performance isn't the only reason you want a fast server. – Jacob Peattie May 24 '18 at 14:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.