简体   繁体   English

扩展TYPO3网站

[英]Scaling for TYPO3 site

I'm asked by a customer to deliver a TYPO3 based website with the following parameters: - small amount of content (about 50 pages) - very little change frequency - average availabilty about 95%/day - 20% of pages are restricted, only available after login - No requirements for fancy typo3 extensions or something else (only Typo3 core) - Medium sized pages - Only limited digital assets (images etc.) included 客户要求我提供一个基于TYPO3的网站,并带有以下参数:-少量内容(约50页)-更改频率很少-平均可用性每天约95%-仅限制20%的页面登录后可用-不需要花哨的typo3扩展名或其他任何内容(仅Typo3核心)-中型页面-仅包括有限的数​​字资产(图像等)

I have the requirements to build an infrastructure to serve up to 1000 concurrent users. 我要求建立一个基础架构以服务多达1000个并发用户。 With the assumption of having an average think time of 30 sec. 假设平均思考时间为30秒。 this would result in 33 Requests per second. 这将导致每秒33个请求。

How could an infrastructure look like? 基础架构看起来如何?

I know that system scaling is a highly individual task depending on the implementation of the system and needs testing, but I need a first indication where to start (single server, separating components to different servers,...). 我知道系统扩展是一项高度独立的任务,具体取决于系统的实现并需要进行测试,但是我需要首先指出从何处开始(单个服务器,将组件分离到不同的服务器等)。

Any idea? 任何想法?

Easier solution is EXT:nc_staticfilecache . EXT:nc_staticfilecache是更简单的解决方案。 This saves the static pages as HTML and your web server automatically delivers them through rewrite rules (in case of Apache through mod_rewrite). 这会将静态页面另存为HTML,并且您的Web服务器会通过重写规则自动将其交付(对于Apache,则通过mod_rewrite)。 This works very well for static content and should already enable you to do >100req/s. 这对于静态内容非常有效,应该已经使您能够> 100req / s。

The even more fancier way is to use Varnish Cache . 更好的方法是使用Varnish Cache Varnish is a reverse proxy server that holds your web site content in memory and can run on a dedicated host. Varnish是一个反向代理服务器,可将您的网站内容保存在内存中,并且可以在专用主机上运行。 If you configure it correctly (send correct cache headers!), it serves you line speed (some million req/s). 如果配置正确(发送正确的缓存头!),它将为您提供线速(约百万req / s)。 There is also a TYPO3 Extension moc_varnish , which eg purges the varnish cache, when a page is changed in TYPO3. 还有一个TYPO3扩展moc_varnish ,例如,当在TYPO3中更改页面时,它将清除清漆缓存。 Also support for edge side includes exists to eg only retrieve the user-specific data from TYPO3 and use the static parts of a page from varnish cache (everything except the " Welcome user Foo Bar ".. ;)). 还存在对边缘侧的支持,例如仅从TYPO3检索用户特定的数据并使用清漆缓存中页面的静态部分(“ 欢迎用户Foo Bar ”之外的所有内容)。

As mentioned: Don't forget to configure correct cache headers (Expires etc) for your assets. 如前所述:不要忘记为您的资产配置正确的缓存头(过期等)。 This already removes some load from your web server. 这已经减轻了您的Web服务器的负担。

It's quite possible, already made something like this. 很可能已经做出了这样的事情。 You need at least one dedicated server with >= 8GB of RAM. 您至少需要一台具有> = 8GB RAM的专用服务器。

If we are speaking about infrastructure, the minimal combination is : 如果我们谈论基础架构,则最小组合为:

  • nginx/Varnish for front/load balancing nginx / Varnish用于前端/负载平衡
  • Apache HTTP Server Apache HTTP服务器
  • MySQL could be on standalone server, could be clustered MySQL可以在独立服务器上,也可以集群

Performance optimization is very important in such cases. 在这种情况下,性能优化非常重要。

Some links for further reading : 一些链接供进一步阅读:

I'd put this on a single dedicated server (or well specified VPS) but maybe keep all the static assets on a third party CDN so you can focus on the dynamic stuff. 我将其放在单个专用服务器(或指定的VPS)上,但也许将所有静态资产保留在第三方CDN上,以便您可以专注于动态内容。 I don't know Typo3 but can't see any reason why you couldn't have your db on the same server for this level of usage - there is sure to be caching options of various kinds. 我不了解Typo3,但是看不到任何原因导致您无法在同一级服务器上使用这种级别的数据库-肯定会有各种缓存选项。 Or perhaps consider a cloud server, so if you need more oomph, just add more resources. 或考虑使用云服务器,因此,如果需要更多功能,只需添加更多资源即可。

Edit: I don't think it is a good idea to build a scalable architecture just yet eg proxy servers and all that stuff. 编辑:我认为构建一个可伸缩的体系结构(例如代理服务器等)并不是一个好主意。 If it is slow and you find you really can't cope with one machine, scale up at that point. 如果运行缓慢,但您发现您真的无法应对一台计算机,请在那一点上扩大规模。 I'm of the view you can make do with a much simpler architecture given your expected traffic. 我认为,鉴于预期的流量,您可以使用更简单的架构。

I would look into a virtual sserver or a ksm and a good mysql and php configuration. 我将调查一个虚拟服务器或ksm以及一个好的mysql和php配置。 When I have a ksm I would tweak Linux and use iptables for traffic shaping. 当我拥有ksm时,我将调整Linux并使用iptables进行流量整形。 A dedicated root server would be nice but it's expensive. 专用的根服务器会很好,但价格昂贵。 Then I would think about using a nginx or lighttpd webserver with eaccellerator and memcache. 然后,我会考虑使用带有eaccellerator和memcache的Nginx或lighttpd Web服务器。 If that doesn't help I would try to compile php and mysql with optimize flags or I would try to compile it with the Intel C Compiler. 如果那没有帮助,我将尝试使用optimize标志编译php和mysql,或者尝试使用Intel C Compiler对其进行编译。 ICC can optimize C code better then gcc. 与gcc相比,ICC可以更好地优化C代码。 If the server has many ram I would use ramdisk. 如果服务器有很多ram,我会使用ramdisk。

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

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