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.
  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.


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." - 온라인바카라 - 샌즈카지노 - 바카라 - 바카라주소 - 슬롯머신사이트 - 온라인카지노 - 카지노사이트 - 카지노검증사이트 - 모바일바카라

people who have a big influence

people who have a big influence on the public through many followers). - 룰렛사이트 - 바카라사이트 - 카지노주소 - 블랙잭사이트 - 온라인바카라 - 카지노사이트 - 모바일카지노 - 슬롯머신사이트 - 온라인카지노

Northern ginseng and Antirrhinum

Snapdragon (Northern ginseng and Antirrhinum majus L Northern Hemisphere) <a href="" target="_blank">슬롯머신사이트</a> <a href="" target="_blank">카지노사이트</a> <a href="" target="_blank">바카라사이트</a> <a href="" target="_blank">온라인카지노</a> <a href="" target="_blank">온라인바카라</a>

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

Add new comment

Target Image