我为在单台计算机上运行的Web应用程序设计了一个架构

我打算构建一台运行在一台计算机上的Web应用程序,并尽可能高效地利用硬件资源。 应用程序的逻辑并不复杂。 以下是我的设计:</ p>

操作系统:Linux(CentOS 5)</ p>

Web服务器:Nginx </ p>

网页脚本:PHP </ p>

数据库:东京内阁+东京暴君</ p>

索引:Sphinx </ p>

我不是 打算使用像MySQL这样的RDBMS,因为我认为带有索引器(Sphinx)的键值存储(东京机柜)将满足部署普通网络应用程序的所有需求,同时具有比MySQL更好的性能。</ p> \ n

我的问题是:这个设计是否是单个计算机的高效架构? 或者如何改进它?</ p>

(我知道这个问题可能是主观的,但我真的需要你的帮助)</ p>

非常感谢〜< / p>

编辑:</ strong> </ p>

我要托管我的应用程序的计算机是普通PC,如8GB~16GB 内存,500G~1TB硬盘等我认为不需要考虑“可扩展性”。 Web应用程序的每个第一步都是从一台计算机启动的,它始终是开始的。</ p>
</ div>

展开原文

原文

I am planning to build a web app running on a single computer and exploit the hardware resources as efficient as possible. The logic of app will not be complex. The following is my design:

OS: Linux (CentOS 5)

Web Server: Nginx

Web script: PHP

Database: Tokyo cabinet + Tokyo Tyrant

Index: Sphinx

I am not going to use RDBMS such as MySQL, cause I think a key-value store (Tokyo cabinet) with a indexer (Sphinx) will meet all the needs to deploy a normal web app, also with better performance than MySQL.

My question is: is this design to be the an efficient architecture for a single computer? Or how to improve it?

(I know this question might to be subjective but I really need your help)

Thank you very much~

EDIT:

The computer I am going to host my app on, is a normal PC, like 8GB~16GB memory, 500G~1TB Hard disk, etc. I think it won't need to consider the "scalability". Every first step of a web app is started from one machine and it will always the beginning.

douluoqiu4538
douluoqiu4538 在单台计算机上运行“网络”应用程序的优势是什么?基于Windowed表单的应用程序不是更合适吗?
10 年多之前 回复
douqiao2008
douqiao2008 机器上有哪些规格?
10 年多之前 回复

2个回答



DB的选择</ strong> </ p>

我认为类型的选择 您制作的数据库取决于系统托管的计算机数量。 我认为这应该更多地取决于您希望/需要保留的数据质量。</ p>

例如,如果您需要为客户存储送货地址,则需要 在您的存储结构中考虑到这一点。 一个名称值对似乎是一个容易开始的结构,但如果您预见到以下任何一种情况,您应该考虑转移到标准数据库系统</ p>


  • 保持跟踪 更改</ li>
  • 报告活动/报告</ li>
  • 并发用户</ li>
    </ ul>

    效果</ strong > </ p>

    这取决于您的代码,图像,内容,缓存等,就像您在数据库中一样。</ p>
    </ div>

展开原文

原文

Choice of DB

I think that the choice of type of database you make depends less on how many computers the system is hosted on. I think this should be more a function of the quality of data that you want/need to preserve.

For example, if you need to store the shipping addresses for a customer, you will need to account for that in your storage structure. A name value pair may seem an easy enough structure to begin with, but if you foresee any of the following, you should consider moving to a standard database system

  • keeping track of changes
  • reporting activity / reports
  • concurrent users

Performance

This is dependent on your code, images, content, caching, etc just as much as it is on your database.



好吧,一种方法是加载测试它:
http://grinder.sourceforge.net/ </ p>

我从未与东京内阁合作,但如果它在功能上足够,那么 它可能比数据库快得多。</ p>

从长远来看,当你开始扩展时,通过调整应用程序在一个盒子上工作所实现的任何节省都会很快消失 那个盒子。 试图添加大量的缓存,以及让应用程序更快的黑客只会到目前为止。 更重要的是,您应该考虑如何轻松地将各层分离。</ p>
</ div>

展开原文

原文

well, one way to see is to load test it: http://grinder.sourceforge.net/

I've never worked with Tokyo cabinet, but if it's functionally sufficient, then it will probably be significantly faster then a DB.

In the long run though, any savings you realize by tuning your app to work on one box will be quickly lost when you start to scale beyond that box. trying to add a lot of caching, and hacks to get the app to be faster will only go so far. More importantly you should try to think about how easily you can decouple the various layers.

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐