• Dear
    I come to you as (almost) always because BEFORE I searched and/or tried “everything”.
    The issue is more or less the following:
    I’m redesigning my site and in the process I’ve made/I’m making/will be making SEVERAL changes.
    Some time ago I noticed that while I was editing one of my pages (on the site I’m redesigning) my site started having problems like…
    …”Error establishing a database connection”…
    I made the corresponding claim to my hosting, and they told me that…
    …”Dear Customer:
    In order to avoid resource shortages and performance degradation problems of the server where your shared account is hosted, we have implemented a default limit of the MySQL variable: max_user_connections for all of our shared hosting packages. If you reach this limit, your website will most likely return an error message similar to this:
    …”Warning: mysql_connect(): User xxxxxxxx already has more than ‘max_user_connections’ active connections to /home/xxxxx/public_html/ xxxxxxxx.php on line X”…
    …”In general, if you are hitting the default max_user_connections limit that we have set, we recommend that you look into further optimizing your application code to reduce slow queries, which are one of the main reasons you may hit this limit, or investigate any potential issues with high traffic or abuse related issues, such as attacks on websites or apps hosted on your account”…

    Something quite “strange” because, the site in question (stage9.atutrabajo.org), is mounted on a subdomain (stage9), with the aim that, on my original site (atutrabajo.org), my (few) visits, DO NOT see the changes I am making until I finish doing ALL the redesign of it.
    Ergo, my site to redesign (stage9.atutrabajo.org) has NO visits, ha!
    In any case, and after “fighting” with them for a while and they gave me other more or less similar “diagnoses”, they ended up saying something like that…
    …” Each cPanel plan has its own resources/limits, which is why there are different levels.
    If you want to be able to change that maximum mysql connection limit, you should consider upgrading your plan to VPS/Cloud”…
    Something that, of course, is NOT going to happen, heh.

    In any case, and before “throwing everything to the m….” (and switch to another hosting), I began to investigate on my own, what things I could do, to improve my installation and thus, reduce this from the … “max_user_connections” …
    Above all, taking into account what they (my hosting) told me about…
    …”(should) Increase max_user_connections to run more than 5 mysql connections simultaneously”…
    Really? Yes. Seriously, heh.
    Anyway.

    That being said, I’ve made a significant number of modifications so far, such as:
    – Add indexes to the most important tables (options, usermeta, etc.)
    – Clean, Delete, Optimize tables
    – Disable persistent connections on the server through…
    Using mysql.allow_persistent=Off in php.ini
    Etc.

    And here comes what gives the title to this ticket. That is to say the…
    Technical question + Opportunity for improvement
    One of the many “recommendations” that I read was that of…
    …”implement an object caching system… (to) directly return results without executing SQL queries again”…
    Ergo. Since I do NOT have access to either Redis or Memcached, I used this tutorial; https://docs.hostsuar.com/aplicaciones/wordpress/que-es-cache-objetos-object-cache-configuracion-uso-wordpress
    With which, in addition to contributing to this “reducing simultaneous queries to MySQL”, I would be “complying” with what I read in my Administration Panel/Tools/Site Health/Recommended Best, in terms of…
    …”You should use a persistent object cache (because)…
    A persistent object cache makes your site’s database more efficient, which results in faster load times because WordPress can retrieve your site’s content and settings much faster.
    Your hosting provider can tell you if persistent object caching can be enabled on your site”…
    Since, as I said, my “hosting provider” does NOT offer me Redis or Memcached (at least in the basic service that I have contracted), I proceeded (as the aforementioned tutorial indicates), to install an object cache with one of the most used caching mechanisms (besides Memcached and Redis), such as APCu.
    And soooo! It worked.
    And what is the problem? Okay. That, as soon as I finish installing said cache… My function.php STOPS WORKING! ??

    And beware, I just realized that the problem happened to me when (temporarily) they had allowed me to have Redis and Memcached (which I NO longer have).
    In other words, the problem is NOT the caching mechanism used, but that, for some reason, function.php and object caching are NOT compatible!

    Conclusion:
    Could you tell me how I can have an object cache and, at the same time, my function.php is NOT misconfigured?
    To be more precise, when I turn on the object cache, and do ANYTHING in my function.php, I get the message of…
    …”Scratch key verification failed. Please try again”… (Or something like that, heh:).

    I await your comments.
    From already thank you very much.
    Greetings.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    If your persistent caching app is causing functions.php to fail, I recommend seeking help through the dedicated support channel of the caching app.

    FWIW, WP does have a built-in object cache, but it is not persistent.

    You might try using the Query Monitor plugin to determine what queries are particularly time consuming and take measures to improve performance of that specific part of the site.

Viewing 1 replies (of 1 total)
  • The topic ‘Technical consultation + Opportunity for improvement’ is closed to new replies.