Design a Drupal Website with a Million Nodes in Mind

Begin to design a Drupal website with a million nodes in mind. We build a Drupal website. It runs well at beginning. Until one day, the system has hundreds of thousands of node. We found the site became slow. We need wait many seconds before we can open a new page. Not only it is slow, but also sometimes we got errors like memory exhausted.

Most time the problem was existed at the beginning stage of a system. When designing a site, there are something we as a developer have to take care. We need bear in mind the site will grow and more and more nodes will come. Everytimes creating a function, we need to make sure the function will work fine when there are hundreds of thousands of nodes in the system. Otherwise, those functions may time out or finish all the memory by those ever increasing nodes in the system.

PHP have a maximum memory limit for each user. Sometimes it is 128 MB. Sometimes it is 256MB. The number is limited, and it is not infinite large for sure. There is no limit on how many nodes can exist on our website. As our system getting larger and larger with more nodes created, we will face the memory limitation sooner or later if we did not take it into consideration at the beginning.

Here is a quick sample. Drupal have a function node_load_multiple(). This function can load all nodes in the database to memory. Here are some codes from one of our contributed module.

foreach (node_load_multiple(FALSE) as $node) {
  // Modify node objects to be consistent with Revisioning being
  // uninstalled, before updating the {taxonomy_index} table accordingly.
  unset($node->revision_moderation);
  revisioning_update_taxonomy_index($node, FALSE);
}

This code is in an implementation of hook_uninstall. It will run into a problem if there are over 10,000 nodes in the system. As a result, we can not uninstall this module. Here is the error message:

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 36 bytes) in ...

It used up all 256MB memory before it can load all the nodes. As the result, the module can never be uninstalled from the site.

It is an extreme case. As we troubleshooting an existing site, we may notice similar case here and there. I also notice that we can do something on the field_sql_storage module to make Drupal running faster and keep SQL database smaller.

Comments

poor article

So you point out that a drupal site designed wrong can have problems with a large number of nodes, but give no advice on how to handle the problem???

Thanks for spend time reading

Thanks for spend time reading the blog and commenting. Indeed, it will be better to have some pieces of advice. But, I think that topic is huge, and I want to focus on raising the awareness of site performance with scalability. We can have a series of blogs discussing performance with a site growth.

If you listen to compliments, can anyone say "Yes."

If you listen to compliments, can anyone say "Yes." http://xn--oi2ba146a24mbtbtvt.zxc700.com - 온라인바카라 http://xn--o80bz00bbzcu6f.zxc700.com - 샌즈카지노 http://xn--oi2b30ghxt.zxc700.com - 바카라 http://xn--on3b21eb4bmwh91q.zxc700.com - 바카라주소 http://xn--mp2bs6av7jp7brh74w2jv.zxc700.com - 슬롯머신사이트 http://xn--o80b27i69npibp5en0j.zxc700.com - 온라인카지노 http://xn--o80b910a26eepc81il5g.zxc700.com - 카지노사이트 http://xn--c79a67g3zy6dt4w.zxc700.com - 카지노검증사이트 http://xn--oi2b43dh5aa317l40j.zxc700.com - 모바일바카라

people who have a big influence

people who have a big influence on the public through many followers). http://xn--7m2b7ov9poqh97o.vom77.com - 룰렛사이트 http://xn--oi2b30g3ueowi6mjktg.vom77.com - 바카라사이트 http://xn--o80by81agsfmwa85o.vom77.com - 카지노주소 http://xn--ij2bx6j77bo2kdi289c.vom77.com - 블랙잭사이트 http://xn--oi2ba146a24mbtbtvt.vom77.com - 온라인바카라 http://xn--o80b910a26eepc81il5g.vom77.com - 카지노사이트 http://xn--o80b67oh5az7z4wcn0j.vom77.com - 모바일카지노 http://xn--mp2bs6av7jp7brh74w2jv.vom77.com - 슬롯머신사이트 http://xn--o80b27i69npibp5en0j.vom77.com - 온라인카지노

Northern ginseng and Antirrhinum

Snapdragon (Northern ginseng and Antirrhinum majus L Northern Hemisphere) <a href="http://zxc.vmm789.com" target="_blank">슬롯머신사이트</a> <a href="http://vmm789.com" target="_blank">카지노사이트</a> <a href="http://cc.vmm789.com" target="_blank">바카라사이트</a> <a href="http://dd.vmm789.com" target="_blank">온라인카지노</a> <a href="http://et.vmm789.com" target="_blank">온라인바카라</a>

Jack

https://ov889nl7426.weebly.com <a href="https://1518363.site123.me " target="_blank">인터넷경륜</a> <a href="https://n1n6b5a91.wix.com/n1n6b5a91 " target="_blank">카지노꽁머니놀이터</a> <a href="https://hr164wn7702.weebly.com " target="_blank">카지노리스보아</a> 카지노자막 <a href="https://1518087.site123.me " target="_blank">바카라앵벌이</a> “그래서 나를 피하려고 했던 거야?” <a href="https://cj3i9buf679.weebly.com " target="_blank">바카라하는방법</a> <a href="https://rd842ep3032.weebly.com " target="_blank">그랑블루카지노</a> https://1514198.site123.me 물장구를 구별 못 할 길동은 아니었던 것이다. https://yi374wf4819.weebly.com <a href="https://m2k1d970.weebly.com " target="_blank">스포츠야구중계</a> https://ga589va2347.weebly.com 노르망디 해안에서 사진 작업을 하면서, 파리에서 간행된 책 <a href="https://an32hk6593.weebly.com " target="_blank">메이저리그문자중계</a>

Add new comment

Target Image