Lekérdezések és cache a Drupalban, mennyi az annyi?

  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • The spam filter installed on this site is currently unavailable. Per site policy, we are unable to accept new submissions until that problem is resolved. Please try resubmitting the form in a couple of minutes.
Kategória: 
Leírás

A drupal.hu-n zajlik épp egy nagyon jó kis thread: Adatbázis teljesítmény optimalizálása. A szolgáltató hozzáállása magyar viszonylatban példaértékű, és ez is hozzájárult némileg a motivációhoz, hogy összeszedjem a Drupal 7 cache rendszerével kapcsolatos tapasztalataimat.

Először oszlassunk érdemes kicsit tisztázni a Drupal cache fogalmát. Egyrészt sokannál a cache fogalma kimerül abban, hogy az a pár bekapcsolható izébizé a performance oldalon.

Összességében: Drupal cache nem egyenlő a anonim felhasználóknak bekapcsolható oldal gyorstárral!

A D7-ben eleve nincsen olyan, hogy „bekapcsoljuk a cache-t”. Egy nagyon komplex, többrétű cache-rendszer van, ami az egyes elemek kiszolgálását végzi.

Ezek lehetnek dedikált elemek, mint pl a Menü gyorstár, Token registry. Vagy nem dedikált, hanem egy bármilyen modul által végzett egyszeri gyorstárazási művelet.

Még egy picit mélyebben, megpróbálom egyszerűen összefoglalni: Minden dedikált cache-nek van a Drupalon belül egy definíciója. Ez mondja meg, hogy mi történjen akkor, amikor ezt a cache-t írjuk, vagy olvassuk.
Pont ezek a definíciók teszik azt lehetővé, hogy az összes típusú cachet egységesen írhassuk, olvashassuk. Amit a modulok - illetve természetesen maga a Drupal is - a cache_get() és cache_set() függvényekkel tesznek meg.

Mire kell a cache rendszer?

Egy példa: Egy node megjelenésekor a címkék mellé ki akarunk írni egy számot, ami a node szerzőjének a node tartalomtípusába tartozó olyan tartalmak összege, amely az adott címkével el van látva.

Ez egy közepesen/kevésbé bonyolult lekérdezést jelent, amit kétféleképpen lehet megcsinálni, jól, vagy rosszul. Tegyük fel, hogy megvan a lekérdezés, ott vannak a megfelelő számok a megfelelő címkék mellett. De hogy került oda? Na ez a nem mindegy!

A legrosszabb: A címke kiírásához kapcsolódó preprocess függvénybe írt lekérdezés. Ilyenkor mondjuk egy 10 node teaserből álló, átlag 4 címkével rendelkező lista kiírásához 40!! plusz lekérdezés fog kapcsolódni!

Jó: Hmm.. És itt most viharban lettem, mert egzakt szabály erre nincsen, több módszert kellene kipróbálni, hogy kiválasszam a legjobbat az adott környezethez, feladathoz.

De 1 dolog mindegyik megoldásban benne van: Valamilyen módon fel kell építeni egy objektumot, és eltárolni cache_set()-el. A legkézenfekvőbb egy nodehoz kapcsolódó cache elem felvétele, amiből visszakapjuk a nodehoz kapcsolódó címéket és a kért számot. De meg lehet próbálni közvetlenül abba a cache-ba írni, ami a mező értékeit tárolja - szóval lehetőség van bőven.

Cache a cacheban

Ezek a cache-ok sokszor egymásba épülnek, tehát teszem azt egy nem dedikált cache elem bele fog épülni a page cache-ba (tehát a ki-bekapcsolható anomim oldalcacheba), de például a views dedikált cache-a is ugyanúgy be fog gyógyulni a page cache-ba, tehát anomymus nem fog kapni cache_get-et a viewstól. És ezért emlegettem az elején, hogy Drupalban nincs olyan, hogy "bekapcsoljuk a cache"-t. A legtöbb cache funkciót nem is lehet állítani.

Folytassuk az előző példát:

Kell egy nézet a főoldalra, ami 10 node-ot tartalmaz, benne az általunk elkészített számozott címke mezővel. Szépen beállítottunk cache_setet az eredményünkre nodeonként, és tegyük fel, hogy nem sikerült belegyógyítani a node rendereléséhez használt cache-ba. Hogyan alakulnak a lekérdezéseink bejelentkezett felhasználóknál?

Ebben az esetben 10 többletlekérdezésbe (cache_get-tel kérdezzük le az egy nodehoz tartozó címkék számait) került a 10 node megjelenítése.

És most jön a vudu: Bekapcsoljuk a views gyorstárazását. (a views szerkesztésekor az "Egyéb" szekcióban található) Ez a cache_views_data táblába menti el a lekérdezés kész html eredményét, még az a 10 többletlekérdezésünk is eltűnik, és csak akkor lesz rá szükség, ha a views ezen gyorstárát kell újraépíteni. Tehát a miáltalunk beállított cache a nodeokhoz ezáltal semlegesítődik, az eredménye beleépült a views gyorstárazás eredményébe.

Sőt! Azzal, hogy a views idő alapú gyorstárazását bekapcsoltuk, semlegesítettünk egy rakás más lekérdezéssel járó függvényt, például node_load, user_node_load, comment_node_load.

Mi ebből a tanulság? Bejelentkezett felhasználók esetében a leggyorsabban a views, panels gyorstárazással javíthatunk a teljesítményen.

Ha pedig bekapcsoljuk a gyorstárazást anonim felhasználóknak, akkor a views gyorstár is semlegesítődni fog, mert ilyenkor a cache_page táblából kapja meg a felhasználó az egész oldal renderelt htmljét.

Remélem érthető, hogy miért nem beszélhetünk "cache"-ról a Drupalban.

De akkor miért van mégis egy csomó lekérdezés bekapcsolt anonymus gyorstárazásnál?

Nagyon nem akarok belemerülni a drupal bootstrap folyamatába, de azért néhány példát kiragadnék:

  1. Mindenek előtt be kell inculde-olni a modulok php file-jait.
  2. Fel kell építeni a változókat, amelyekből például azt állapitja meg a drupal, hogy ez most front_page-e vagy nem.
  3. Fel kell építenie egy menüelem-objektumot, amely olyanokat tartalmaz, mint például a felhasználó hozzáférhet-e az adott oldalhoz, vagy nem.
  4. A legtöbb esetben álnevekkel dolgozunk. Meg kell állítani, hogy az adott álnév milyen útvonalhoz kapcsolódik, milyen tartalom tartozik hozzá.
  5. Fel kell építenie egy $user objektumot. Mert bizony, az anonim felhasználó is felhasználó, van neki neve, vannak jogosultságai, a hozzá kapcsolódó adatokat sokszor használják modulok.

És ezek még csak a core dolgai! Egy gyors mérés szerint egy frissen telepített, majdnem szűz drupal kb 30 lekérdezést produkál anonim userek page cacge kiszolgálásakor. Egy komplexebb oldal esetében ez simán felszaladhat 100 fölé.

És igen, szolgáltatóként ezt marha nehéz lekezelni. Engem két olyan oldallal dobtak ki magyar szolgáltatók, amik az én külföldi, jóval olcsóbb és ugyanúgy shared hosting szolgáltatómnak (hehe, ez egy affiliate link. :)) meg se kottyant. Drupallal nagyon könnyű kinőni egy shared hostingot, és nagyon kevés esetben van arra keret, hogy tényleg igazán elejétől a végéig teljesítményoptimalizáljuk az oldalt. Ilyenkor mindenképpen kompromisszumos megoldás kell, erre Drupal vonalon talán a Boost modul a legmegfelelőbb, ha zömében anonim oldallekérések vannak.

Hozzászólások

Keep up the helpful job and

Keep up the helpful job and generating the crowd! sites:ggglese.com
fotbollströjor barn http://www.die-design-manufaktur.de/?option=com_k2&view=itemlist&task=us...

You have got among the finest

You have got among the finest online websites.

Good day, cool websites

Good day, cool websites you've in here.

Great looking website. Think

Great looking website. Think you did a bunch of your very own html coding.

I love reading your website.

I love reading your website. Thanks a lot!

Great looking internet site.

Great looking internet site. Assume you did a bunch of your own html coding.

Great internet site! It looks

Great internet site! It looks extremely expert! Sustain the helpful job!

Terrific content you possess

Terrific content you possess right here.

Great internet site! It looks

Great internet site! It looks really professional! Sustain the good job!

Wow....this is a beneficial

Wow....this is a beneficial website.

Really wished to express Now

Really wished to express Now i'm delighted I came on the web page.|

What's up, great website you

What's up, great website you have got presently.

Basically had to point out

Basically had to point out Now i'm relieved that i happened upon your web page!|

With thanks for sharing your

With thanks for sharing your amazing internet site.

Much thanks! This is

Much thanks! This is definitely an impressive site!

billiga fotbollströjor

You have fantastic info at

You have fantastic info at this point.

I adore this website - its so

I adore this website - its so usefull and helpfull.

nphihung. steerhome.

smdservicesllc. newswit.

You have got one of the

You have got one of the greatest web-sites.

jabulaniholdings. clevio.

clevio. bambikasafaris.

I read this paragraph

I read this paragraph completely on the topic of the resemblance of latest and earlier technologies, it's awesome article.

Feel free to visit my homepage; impact wrench socket set

Great post. I was checking

Great post. I was checking continuously this blog and
I am impressed! Extremely helpful info particularly the remaining part :) I
deal with such information a lot. I used to be seeking
this particular information for a long time. Thank you and best of luck.
http://www.fastrocs.org

A pertson necessarily assist

A pertson necessarily assist to make severly articles I might state.
This is the veery first time I frequented your website page and thus far?
I amazd with the analysis you made too create this particular post extraordinary.
Great task! http://www.bestcontactform.org

Hello my loved one! I want to

Hello my loved one! I want to say that thjis postt is awesome,
great wrditten and come with approximately all important infos.

I'd like to liok extra posts like this . http://www.gzceol.com

I am actually glad to read

I am actually glad to read this weblog plsts
whch includes plenty of useful information, thanks for providing such statistics.
http://www.areyoueclectic.com

It's actually a nice and

It's actually a nice and helpful piece of info.
I am satisfied that you simply shared this helpful info with us.
Please keep us informed like this. Thank you for sharing.
http://www.emremineoglu.com

Just wwant to say yourr

Just wwant to say yourr article is as surprising. The clarity in your post is just excellent and i can assume you're an expert on this
subject. Well with your permission let me tto grab yolur feed to
keep updated with forthcoming post. Thanks
a million and plewase carry on the enjoyable work.
http://www.electmarshall.com

Heey would you mind sharing

Heey would you mind sharing which blog platform you're working with?

I'm planning to start my own blog in the near future but I'm having a tough time making a
decision between BlogEngine/Wordpress/B2evolution and Drupal.
Thhe reeason I ask is because your dsign and style seems different
then most blogs and I'm looking for something completely unique.
P.S My apologies for being off-topic but I had to ask!
http://www.financialhealthsolutions.net

Heey would you mind sharing

Heey would you mind sharing which blog platform you're working with?

I'm planning to start my own blog in the near future but I'm having a tough time making a
decision between BlogEngine/Wordpress/B2evolution and Drupal.
Thhe reeason I ask is because your dsign and style seems different
then most blogs and I'm looking for something completely unique.
P.S My apologies for being off-topic but I had to ask!
http://www.financialhealthsolutions.net

I just could not go away your

I just could not go away your website prior to suggesting that I actually enjoyed the standard information a person provide for your visitors?
Is going to be back often to inspect new posts

My web blog gta online money glitch

This design is incredible!

This design is incredible! You definitely know how to keep a reader amused.
Between your wit and your videos, I was almost moved to start my own blog (well, almost...HaHa!) Fantastic job.

I really loved what you had to say, and more than that, how you presented it.
Too cool!

Also visit my web blog :: gta 5 Money glitch solo

There are several reasons she

There are several reasons she could be vomiting, and many likely her
vomiting.

Sometimes a veterinarian will put absorbable sutures there so that you do not have to visit back, but I want to check
the incision, and become sure that everything has
healed properly. For broken nails, clip the affected nail just over the area of the
vein that runs within the nail, and file any sharp edges by having an emery board.
The purple flowers of a lavender plant have a lemon-like
flavor that's pleasing to some dogs. For wintertime activities,
your accommodation is located 12 miles from Natanis Snowmobile Trails.
zimbabwe dog breeds Sometimes a veterinarian will put absorbable sutures there so that you do not have to visit back, but I want to check the incision,
and become sure that everything has healed properly. For
broken nails, clip the affected nail just over the area of
the vein that runs within the nail, and file any sharp edges by
having an emery board. The purple flowers of
a lavender plant have a lemon-like flavor that's pleasing
to some dogs. For wintertime activities, your accommodation is located 12 miles from Natanis
Snowmobile Trails.

When I originally left a

When I originally left a comment I appear to have clicked on the -Notify me when new comments are added- checkbox
and now each time a comment is added I recieve 4 emails with the
same comment. There has to be a way you are able to remove me from that
service? Thanks!

Feel free to surf to my page: gta 5 money glitch 1.30 (https://youtube.com)

Verify your billing and

Verify your billing and contact information, then select "paypal login" from the payment options.

You can verify a Pay - Pal

You can verify a Pay - Pal account using a Prepaid credit
card as long as you have greater than $1.

From paying your bills to buying items online, our Pay - Pal accounts.
For a seller to be protected under the Seller's Protection Policy at
Pay - Pal they are only able to ship merchandise to confirmed
Pay - Pal addresses. File a dispute through the Resolution Center if your seller doesn't grant your money back by
clicking "Dispute a Transaction" then "Item Dispute"
and deciding on the transaction under consideration when prompted.
You will get free gift cards in case you use pharmacy coupons to transfer your
prescriptions from drugstore to drugstore. paypal.com From paying your bills to buying
items online, our Pay - Pal accounts. For a seller to be protected under the Seller's Protection Policy at Pay - Pal they are only able to ship merchandise to confirmed Pay
- Pal addresses. File a dispute through the Resolution Center if your seller doesn't
grant your money back by clicking "Dispute a Transaction" then "Item Dispute" and deciding on the transaction under consideration when prompted.
You will get free gift cards in case you use pharmacy coupons
to transfer your prescriptions from drugstore to drugstore.

Touche. Sound arguments. Keep

Touche. Sound arguments. Keep up the great work.

Here is my web blog; gta money glitch

Android is often a mobile

Android is often a mobile main system developed by Google that places a great deal of focus on cloud-based solutions for data storage.

ID along with the security code inside box in the
fields and then click the "Next" button.

It's a little frustrating whenever you've got to fix an error on the.
Private messages in Facebook give a quick approach to open communication with someone.
For example, should you open Yahoo Mail in one tab on your own browser, and then open other tabs to test
the weather or perhaps the news, Yahoo will ultimately sign you out of your money due to inactivity.

When Bellsouth was acquired by AT&T, customers were still able to keep their
old Bellsouth email accounts. www.mail.yahoo.com It's a little frustrating whenever you've got to fix an error on the.
Private messages in Facebook give a quick approach to open communication with someone.
For example, should you open Yahoo Mail in one tab on your own browser,
and then open other tabs to test the weather or perhaps the
news, Yahoo will ultimately sign you out of your
money due to inactivity. When Bellsouth was acquired by AT&T, customers were still able to keep their old
Bellsouth email accounts.

Hi to all, since I am in fact

Hi to all, since I am in fact eager of reading this web
site's post to be updated on a regular basis. It includes fastidious data.

Also visit my page :: gta 5 online money glitch

Hey there! This post couldn't

Hey there! This post couldn't be written any better!

Reading through this post reminds me of my previous room mate!
He always kept chatting about this. I will forward this page to him.
Fairly certain he will have a good read. Many thanks for sharing!

my web blog; destiny Strange coins easy

Every new Blackberry cell

Every new Blackberry cell phone comes with a software
CD called Blackberry Desktop Manager. com and click on the hotmail live - kayser-immobiliendienst.de - icon on the top left
of the screen.

I loved as much as you will

I loved as much as you will receive carried out right here.
The sketch is tasteful, your authored subject matter stylish.
nonetheless, you command get got an shakiness over that you wish be delivering the
following. unwell unquestionably come more formerly
again as exactly the same nearly a lot often inside case you shield this increase.

Feel free to visit my page ... friv games tips and tricks (http://www.runwaycycling.co.uk/index.php/component/k2/itemlist/user/531370)

One with the great advantages

One with the great advantages of which has a Facebook account is that
you may locate and interact with people you've lost.
Follow the steps to develop a facebook login account should you do
not have already got one.

Keep on working, great

Keep on working, great job!

Visit my homepage; NBA 2k16 Vc Glitch

You can find excellent

You can find excellent chinese food near me bridgeport ct cuisine in vibrant South Beach in Miami, with the recently renovated Gulfstream Park in Hallandale, and even in a
unpretentious strip mall in Lauderdale Lakes. She has completed numerous writing assignments to get a number of publications that include CNN as well
as other websites.

Hola! I've been reading your

Hola! I've been reading your web site for some time now and finally got the courage to
go ahead and give you a shout out from Houston Tx! Just wanted to tell you keep up the great
job!

My blog; free fifa 16 coins mmoga

I couldn't refrain from

I couldn't refrain from commenting. Perfectly written!

Here is my web blog ... batman gifts for boy - bodilsminde.dk,

Hozzászólás

A mező tartalma nem nyilvános.
  • Internal paths in double quotes, written as "internal:node/99", for example, are replaced with the appropriate absolute URL or relative path.
  • Engedélyezett HTML elemek: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <del> <img>
  • A webcímek és email címek automatikusan linkekké alakulnak.
  • A sorokat és bekezdéseket a rendszer automatikusan felismeri.
  • Engedélyezett HTML elemek: <a> <blockquote> <br> <cite> <code> <dd> <del> <div> <dl> <dt> <em> <li> <ol> <p> <span> <strong> <ul>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <bash>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <mysql>, <php>, <python>, <ruby>, <sql>. The supported tag styles are: <foo>, [foo].
  • Minden email cím át lesz alakítva ember által olvasható módon, vagy (ha a JavaScript engedélyezett) ki lesz cserélve kattintható, de biztonságos hivatkozásra.