简体   繁体   English

什么决定了服务器或 LAMP 堆栈的最大并发用户数?

[英]What determines a server's or LAMP stack's max concurrent users?

I'm looking to build my own server for the fun of it and in order to learn about the process.我正在寻找构建自己的服务器以获得乐趣并了解该过程。

I will be setting up a LAMP stack on the server and use it as a back-end for my mobile application that has some 1000s of daily active users.我将在服务器上设置一个 LAMP 堆栈,并将其用作我的移动应用程序的后端,该应用程序每天有大约 1000 名活跃用户。

But I am completely clueless as to what determines the limits of my server.但是我完全不知道是什么决定了我的服务器的限制。 I see on many hosting providers' websites that they offer a fixed amount of concurrent users, like 20 or 100.我在许多托管服务提供商的网站上看到他们提供固定数量的并发用户,例如 20 或 100。

What are the reasons that determine the maximum number of concurrent users for a server ?决定服务器最大并发用户数的原因是什么 Is it just dependent on the server's hardware, like available RAM?它是否仅取决于服务器的硬件,例如可用的 RAM? Does it have to do with code or software?它与代码或软件有关吗? What happens to users who try to access the server when the maximum limit has already been reached?当已达到最大限制时尝试访问服务器的用户会发生什么?

Your question is not really about any code issue, but since you asked...您的问题实际上与任何代码问题无关,但是既然您问了...

I will be setting up a LAMP stack on the server and use it as a back-end for my mobile application that has some 1000s of daily active users.我将在服务器上设置一个 LAMP 堆栈,并将其用作我的移动应用程序的后端,该应用程序每天有大约 1000 名活跃用户。

If you care about the performance, you probably should use LEMP instead of LAMP.如果您关心性能,您可能应该使用 LEMP 而不是 LAMP。

But I am completely clueless as to what determines the limits of my server.但是我完全不知道是什么决定了我的服务器的限制。 I see on many hosting providers' websites that they offer a fixed amount of concurrent users, like 20 or 100.我在许多托管服务提供商的网站上看到他们提供固定数量的并发用户,例如 20 或 100。

All servers you can buy can be divided into 3 simple groups:您可以购买的所有服务器可以分为 3 个简单的组:

  1. Shared hosting (you and 1000 other folks share the same server).共享主机(您和其他 1000 人共享同一台服务器)。
  2. VPS/VDS (the server is divided into N isolated parts and your resources are guaranteed: M CPU cores, K RAM, T GB HDD/SSD, S GB in/out traffic). VPS/VDS(服务器分为N个独立的部分,保证你的资源: M个CPU核, K RAM, T GB HDD/SSD, S GB进出流量)。
  3. Dedicated servers (you own everything).专用服务器(您拥有一切)。

If you see any limitation like " X max connections" or " Y SQL queries per second", that means you talk about the shared hosting.如果您看到任何限制,例如“ X最大连接数”或“ Y SQL 每秒查询数”,这意味着您谈论的是共享主机。 You are not allowed to consume more than your limit, otherwise all clients of the same server may suffer from your website/service "popularity".您的消费不得超过您的限制,否则同一服务器的所有客户端可能会受到您的网站/服务“人气”的影响。 Stick to the VPS/VDS at least if you don't want to hear about boring limitations, your only limitations will be cores, RAM, HDD space and traffic usage.如果您不想听到无聊的限制,请至少坚持使用 VPS/VDS,您唯一的限制将是内核、RAM、HDD 空间和流量使用。

What happens to users who try to access the server when the maximum limit has already been reached?当已达到最大限制时尝试访问服务器的用户会发生什么?

Depends on your client's software configs and server's configs.取决于您的客户端的软件配置和服务器的配置。 The default behavior for most of clients (like browsers) is to wait until a specific timeout.大多数客户端(如浏览器)的默认行为是等待特定超时。 The default behavior for most of webservers (Apache/Nginx) is to keep connections in a queue until the interpreter (PHP-CGI/PHP-FPM) would become available or die if a timeout is reached (whatever comes first).大多数网络服务器 (Apache/Nginx) 的默认行为是将连接保持在队列中,直到解释器 (PHP-CGI/PHP-FPM) 可用或在达到超时时终止(以先到者为准)。 But that's configurable for each actor in that scheme from increasing the timeout to dropping the extra load immediately.但这对于该方案中的每个参与者都是可配置的,从增加超时到立即丢弃额外负载。

PS If you really want to test your server performance, you can always use a regression testing/benchmarking software or write your own (flood your own server with connections until it would die). PS如果你真的想测试你的服务器性能,你总是可以使用回归测试/基准测试软件或编写自己的(用连接淹没你自己的服务器,直到它死掉)。

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

相关问题 增加LAMP服务器上的最大并发文件上传数 - Increasing the max concurrent file uploads on a LAMP server php内置开发服务器的最大并发连接数 - Max concurrent connections for php's built in development server 对于一个带注释的简单博客,LAMP堆栈源代码有什么用? - What's a good piece of LAMP-stack source code for a simple blog w/ comments? 对于使用LAMP Stack的Windows用户,对于GIT和部署,什么是一个好的工具链和部署过程? - What's a good toolchain and deployment process for GIT and Deployment for a Windows user working on a LAMP Stack? LAMP堆栈的PHP无法正常工作(Ubuntu 13.10 / Apache 2.4.6) - LAMP stack's PHP not working (Ubuntu 13.10 / Apache 2.4.6) LAMP服务器的Linux用户和组 - Linux users and groups for a LAMP server 是什么决定了PHP的FilesystemIterator的顺序,我可以更改吗? - What determines the order of PHP's FilesystemIterator and can I change it? 在LAMP群集中管理php会话的最佳方法是什么? - What's the best way to manage php sessions in an LAMP cluster? LAMP站点上较长的目录路径/名称和URL的不利之处是什么? - What are the downsides of longer directory paths/names and URL's on a LAMP site? 我的并发编程逻辑怎么了? - What's wrong with my concurrent programming logic?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM