Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-12-21 04:07:56

HAC
Member
From: Vietnam
Registered: 2009-06-05
Posts: 33
Website

How to speed up TXP to power a website with thousand of articles?

Hi everybody,

In order to continue developing my personal website, i beg your support in speeding up the TXP system. I’m building my personal website with thousand of articles… and it will grow bigger and bigger to about 1 million articles!

Right now, i’ve just imported a section, at this address http://www.chasoft.net/lyrics/?c=vietnamese, it has 10,000 articles! and i have many other section to import! I feel my website is a bit slower, and I wonder about the speed if i import my first 100k articles! the speed of:
- loading articles.
- searching articles in a specified section.

Do you have any advice for my website powered by TXP?

Thank you so much in advanced!

——————— PS ————————

loading… the main page (http://www.chasoft.net/lyrics/?c=vietnamese)
bc. <!— Runtime: 1.3339 —>
<!— Query time: 1.274746 —>
<!— Queries: 30 —>
<!— Memory: 2828Kb, <txp:site_url /> —>

loading.. an articles
bc. <!— Runtime: 1.1122 —>
<!— Query time: 1.080233 —>
<!— Queries: 36 —>
<!— Memory: 2907Kb, <txp:title /> —>

Last edited by HAC (2009-12-21 04:15:49)

Offline

#2 2009-12-21 04:35:20

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: How to speed up TXP to power a website with thousand of articles?

My guess (and it is a guess) is that this is equally to do with MySQL as a back-end database as it is to do with TXP’s architecture. MySQL is not always built for speed (in fact, relational databases aren’t built for speed and are counter-intuitive when it comes to forcing multi-dimensioned networks of data into two-dimensional tables, but that’s a whole other topic that I could bore you with another day!)

With regards speeding up TXP, I’m not sure off-hand which tables have indexes on them but you could try setting some up as a first port of call to see if it helps. It should make it feel nippier if you index the textpattern table though, again, with such vast numbers of articles you might find that MySQL spends more time managing the indexes than it does delivering the data so your admin-side publishing slows down as your public-side gains a modicum of speed. It probably depends what’s more important to you: your site visitors or your publishing workflow :-)

I might be way off base here, though: relational database structure is not my core competence. I do know that the (current) TXP table design is not particularly optimised for large data volumes and people have claimed to have over 6 million rows in other MySQL databases without incident, so perhaps it is TXP’s architecture that is holding your site back. Put your site in Testing mode (EDIT: I see you’ve already done this!) and look at the stats at the bottom of the HTML source code. Stuff there might give you a clue if it’s sheer number of queries or hardware limitations affecting performance the most.

From a site design perspective, you could also try limiting searches to certain sections by offering dropdowns to let users pick the section(s) they wish to search. The smd_query plugin can help you design your own filters. That might present your visitors with a perceived speed benefit, even though it limits their searches.

Other people on the forum may have more concrete ideas on how to boost things in an article-heavy site. With my limited knowledge in this field (at least when it comes to plain old-fashioned relational DBs) I don’t know how much influence you can exert over this without throwing hardware at it (fast, quality RAM for starters) and/or using a different database engine and/or remodelling TXP’s table design.

Hope some of that is (at least partially) useful until others can chime in with better, more informed suggestions.

Last edited by Bloke (2009-12-21 04:41:44)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

#3 2009-12-21 07:47:06

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: How to speed up TXP to power a website with thousand of articles?

..or try to enable caching. It can be done with plugins and third side software, for ex. weboptimiser – it install rather fast\simple and work good on TXP


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#4 2009-12-21 07:52:13

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: How to speed up TXP to power a website with thousand of articles?

Do you have any advice for my website powered by TXP?

Never list thousands of articles at once. What ever you are using, it will be always slow. Limit queries to some extent and offer visitors a pagination instead showing everything at once.

The extra rows will slow DB down, some, but it’s called database for a reason. Looking from lots of data is faster than pulling out lot of data. If the site usage (visitors) gets too heavy (server goes down and such), then you will need dedicated MySQL server or servers.

Offline

#5 2009-12-21 12:30:29

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: How to speed up TXP to power a website with thousand of articles?

Switch to debug mode in TXP, then look at the HTML source to find which queries are slow. Once you know that you can try to optimize those queries. You can’t optimize unless you know what’s making the website slow.

Offline

#6 2009-12-21 20:00:52

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: How to speed up TXP to power a website with thousand of articles?

As Bloke said above:

My guess (and it is a guess) is that this is equally to do with MySQL as a back-end database as it is to do with TXP’s architecture.

Download some MySQL admin tools and check all the DB performance bottlenecks. Example: It helps a lot to have /tmp in a tmpfs environment. Well, and RAM is always a DB issue :)

The question to answer first is: Which queries or query combinations do have to perform a full table search?


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#7 2009-12-21 22:18:12

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: How to speed up TXP to power a website with thousand of articles?

I would also consider hardware as part of the equation. Do you have another install on the same server that is faster? I’m getting much faster times on much more queries.

Offline

#8 2009-12-22 02:21:02

HAC
Member
From: Vietnam
Registered: 2009-06-05
Posts: 33
Website

Re: How to speed up TXP to power a website with thousand of articles?

i greatly appreciate all your advices. i’m trying my best… _
i’ll show all of you when my personal website reach 100k articles

Offline

#9 2009-12-26 03:58:45

HAC
Member
From: Vietnam
Registered: 2009-06-05
Posts: 33
Website

Re: How to speed up TXP to power a website with thousand of articles?

i’m facing difficulty in managing articles! i want to have edit, delete in front end!

it’s ok with edit link, using the code below

<txp:rvm_if_privileged>
<a href="<txp:site_url />textpattern/index.php?event=article&amp;step=edit&amp;ID=<txp:article_id />">edit</a>
</txp:rvm_if_privileged>

but how about delete link?

Offline

#10 2009-12-26 04:31:02

HAC
Member
From: Vietnam
Registered: 2009-06-05
Posts: 33
Website

Re: How to speed up TXP to power a website with thousand of articles?

problem solved!

looking into the code of http://www.syserror.net/textpattern/files/ebl_articleDelete_v0.1.txt

i have a valid delete link:

<txp:rvm_if_privileged>
<a href="<txp:site_url />textpattern/index.php?event=article&amp;step=edit&amp;ID=<txp:article_id />">edit</a> | 
<a href="<txp:site_url />textpattern/index.php?event=article&deleteID=<txp:article_id />&action=delete">delete</a>
</txp:rvm_if_privileged>

Last edited by HAC (2009-12-26 04:32:45)

Offline

Board footer

Powered by FluxBB