简体   繁体   English

Drupal性能-突然的用户爆发

[英]Drupal Performance - Sudden user burst

We run a Drupal site, and are expecting a sudden burst of users some time soon. 我们运行着一个Drupal网站,期望不久后用户会突然激增。

What are some of the best Drupal practices to handle sudden burst of: - User registrations - User Authentication 什么是处理以下突发事件的最佳Drupal最佳实践:-用户注册-用户身份验证

These operations are heavily dependent on database... so, how do we optimize that? 这些操作在很大程度上取决于数据库...因此,我们如何优化它? Are there any techniques that minimize DB interaction during User Authentication? 是否有任何技术可以最小化用户身份验证期间的数据库交互? (for example: storing objects in memory, and writing them to DB at a later point in time?) (例如:将对象存储在内存中,并在以后的某个时间点将它们写入DB?)

Any tips are greatly appreciated. 任何提示,不胜感激。

User authentication and registration usually aren't processes that you can cache or delay (as in MySQL's INSERT DELAY ). 用户认证和注册通常不是您可以缓存或延迟的过程(如MySQL的INSERT DELAY )。 However, there are things you can do to alleviate some load. 但是,您可以采取一些措施来减轻一些负担。 For example: 例如:

  • Allow users to stay logged in via cookie so that you can avoid the DB access of having to re-authenticate 允许用户通过Cookie保持登录状态,这样您就可以避免必须重新验证数据库访问权限
  • In general, store commonly used/small bits of data in the user's session or a memcached block 通常,将常用/少量数据存储在用户会话或内存缓存块中
  • In general, cache as much as possible with memcached 通常,使用memcached尽可能多地缓存

Some of the commercal drupal distros (like Aquia or presflow ) have support for multiple DBs, this may help a little. 一些商业Drupal发行版(例如Aquiapresflow )支持多个DB,这可能会有所帮助。 I would say if your hardware is halfway decend you would have to have a major surge to worry. 我要说的是,如果您的硬件下降一半,您将不得不担心得很大。

User registration and user auth is usually not a problem. 用户注册和用户身份验证通常不是问题。 Having a lot of users that are logged on can be a problem however. 但是,有很多用户登录可能是一个问题。 Drupal doesn't do much caching for logged in users. Drupal对登录用户没有太多的缓存。 The reason is that the pages will look slightly different to each user when displaying user specific stuff. 原因是当显示用户特定的内容时,页面对每个用户而言看起来会略有不同。 You can cache parts of a page which is the same for all to decrease the load. 您可以缓存页面的所有部分都相同以减少负载。 I don't have experience with it myself, but I've heard about a setup that did it. 我自己没有经验,但是我听说过可以做到的设置。 Doing this won't be that easy though. 这样做并不是那么容易。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM