Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-06-05 11:31:07

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355
Website

[howto] Hack to optimize performance Textpattern

A few days ago, I optimized the mysql server and several sites Textpattern. Unfortunately, when the load increases begins to slow down Textpattern.

The load was not high: the main site – 150k hits per day (this only calls textpattern. Images, css, js, static files – provides a different service), other sites in Textpattern summarily – 120-140k hits.

Symptoms: severe load mysql, slow down when you open the pages, a low percentage of cache mysql queries (internal cache of mysql server).

Solution: remove lines from a file publish.php, function preText()

	if ($np = getNextPrev($id, $Posted, $s))
		$out = array_merge($out, $np);

Note: After removing these lines `link_to_next`, `next_title`, `link_to_prev`, `prev_title` tags will not work.

I do not understand WHY the function preText() performs the processing of tags `link_to_next`, `next_title`, `link_to_prev`, `prev_title`. Is this function must ensure that the processing of ANY tags??

IMHO, All tags must be processed to the extent of their use, and certainly not while parsing input parameters.

The result: reduced load mysql with 15-17% to 8-10%
Now: Query cache efficiency: 79.0% (11M cached / 15M selects) – Total sql queries 15M, 11M of them was taken from the mysql cache.

This result can be improved, because widely used is not optimized tag article_custom (this tag is not cached by mysql), which will later be replaced with a plug-in.

At my site structure – 3-4k of articles in the section, the function getNextPrev() generates two unnecessary and heavy sql query to each article even if they never used prev/next. In my case, using prev and next links does not make sense.

Upd: submit Issue 205

Last edited by makss (2012-06-05 12:16:35)


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

#2 2012-06-05 14:16:32

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: [howto] Hack to optimize performance Textpattern

This is a relict of Textpattern’s blog engine history where the posting date is the prevalent sort criterion. It will probably vanish with issue 119.

Offline

#3 2012-06-05 18:53:37

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355
Website

Re: [howto] Hack to optimize performance Textpattern

wet wrote:

This is a relict of Textpattern’s blog engine history where the posting date is the prevalent sort criterion.

I do not break the relics and offer to remove from preText() and transfer the processing tag in the appropriate place – the first call to any of these tags.

It will probably vanish with issue 119.

Issue 119 describes only some improvement in sorting. That are not critical to the performance Textpattern, so these changes will be implemented will not soon…

I noticed a more important part – the low speed of Textpattern, severe load mysql and proposed a temporary solution to this problem.

In one day, I grew up traffic from search engines more than 2.5 times, it was an event-oriented traffic, such situations can not always predict, therefore, my hosting has fallen.

I had already knew about the troubles in preText(), so work quickly restored the host.
I hoped that my post will be useful to someone who will be in this situation. I also think that it is necessary to inform the community of Textpattern to potential problems – Issue 205 – That was removed with a mark SPAM… NO comments from me.

wet wrote:

Please stop spamming hte issue queue.

Unfortunately for a long time ago, Textpattern is the brainchild of one(two) developer and it is becoming more visible.
The situation in the near future will not change. :(

It is unpleasant, so I stop any proposals to change the key functions of Textpattern. Support for my plugins and their development will continue without change.

Please delete all of my open issue and patches. Textpattern OWNER said SPAM – then it’s spam.
There will be a clean sheet issues and buggy system.

ps: In all, there are good points – I find it hard to describe the changes and proposals – it takes me a long time, English is not my native language. Therefore, the time saved, I use to write the code – it would be more useful for me.


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

#4 2012-06-06 04:36:44

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: [howto] Hack to optimize performance Textpattern

makss wrote:

Issue 119 describes only some improvement in sorting. That are not critical to the performance Textpattern, so these changes will be implemented will not soon…

Issue 119 is currently labeled with Milestone 4.5. I do not know of any intentions to punt it to a later release.

Please delete all of my open issue and patches.

I’m not sure whether we can do that, as Textpattern is distributed under the GPL license and so is anybody’s contributed code.

Textpattern even contains change sets on top of code which resulted from some of your patches so even if deleting your patches would be feasible under the GPL it might become complicated very quickly.

Offline

#5 2012-06-06 05:04:12

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355
Website

Re: [howto] Hack to optimize performance Textpattern

my open issue and patches – ie not approved (status ‘new’ or search `open issue` in Issue list), because it reports the error and prevent the person you think you have them as spam.

My patch is applied more than you have indicated and I am glad that they were useful for the community.

Last edited by makss (2012-06-06 05:34:38)


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

#6 2012-06-26 18:23:13

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: [howto] Hack to optimize performance Textpattern

Try r3847.

Offline

#7 2012-07-13 09:12:00

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355
Website

Re: [howto] Hack to optimize performance Textpattern

Thanks


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

Board footer

Powered by FluxBB