从哪里/如何开始扩展一个简单的 LAMP 社交网站
我一直在使用 elance 的独立承包商创建一个午餐社交网站,它几乎准备就绪(托管在 godaddy 上),后端仅使用 php+mysql,前端使用 htlm+css。每当我看到其他网站时,他们都会使用很多其他东西,例如 memacached、负载均衡器 HAProxy 主机 Amazon EC2 等
我什么时候需要开始获取额外的架构?以及如何决定我需要哪些其他工具/硬件?
i have been using independent contractors from elance to create a social netowrking site for lunches, its almost ready (hosted on godaddy) with only php+mysql on the backend and htlm+css on the front end. Whenver i see other sites they use lot of other things like memacached, load balancers HAProxy host Amazon EC2 etc
When do i need to start getting the extra architecture? and how to even decide what other tools/hardware i need?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
监控请求和站点的成功。并测量您的网络服务器和数据库的响应时间和CPU使用率、系统负载和内存消耗。
将它们绘制出来并贴在墙上并保持最新状态。您需要这些历史信息来做出明智的决策。
如果你看到指数增长,那么你就有麻烦了,但你仍然有一些时间。
聘请独立人士来审查您的设置的可扩展性。您不能只是在问题上使用缓存和代理而不知道它们是否有效。
如果你正在成长,你需要知道你首先会遇到哪些瓶颈。这一点很重要,因为任何时候都只有一个瓶颈,而解决其他可能的“瓶颈”会分散时间、注意力和金钱,而且只能带来边际效益。
出于某种原因,许多技术人员喜欢修复那些容易修复的东西,而不是修复真正需要修复的东西。 (我想知道这是否是这句话的根源:“如果你不参与解决方案,那么延长问题就能赚大钱”)。
祝您发布顺利!
Monitor the requests and the success of your site. And measure the response time and CPU usage of your webserver and the database, the load of the system and memory consumption.
Plot these out and stick them to the wall and keep them up to date. You need this historical information to make informed decisions down the line.
If you see exponential growth, then you're in trouble, but you still have some time.
Get an independent to review the scalability of your setup. You cannot just throw caches and proxies at the problems without knowing if they are going to be effective.
If you are growing you need to know which bottlenecks you will hit first. This is important because there always is only one bottleneck at any one time and fixing possible other "bottlenecks" are a diversion of time, focus and money, and they will only provide marginal benefits.
For one reason or another a lot of technical folks like to fix the things which are easy to fix instead of fixing the things which really need to be fixed. (I wonder if this is the root of the saying : "If you are not part of the solution, there is good money to be made in prolonging the problem").
Good luck with your launch!
首先看看您的网站将会有多受欢迎。在小鸡孵化之前,不要数它们;)。也就是说,当它在峰值负载下开始变慢时,请观察增长并通过额外的编程和硬件来解决它。
在实施 memcached 等之前,您需要使用专用服务器。共享的 godaddy 服务器在任何可观的负载下都会很快崩溃,而且众所周知,它们会在没有通知的情况下关闭您。好好监控你的流量。
如果网站在构建时没有考虑到可扩展性,那么您最终可能会支付与开发网站以使其可扩展性相同或更多的费用。
从长远来看,这是本地开发人员更好的原因之一,您可以在非正式对话中提出这些类型的问题,并为此规划架构。您要么现在支付更多费用,要么以后支付更多费用。
祝你好运。
编辑
不可能知道您的应用程序将占用多少资源。每个网站都不同。这取决于查询的效率等。
我认为godaddy有cpu、带宽和内存的监视器供你查看。您应该使用这些并与您的计划进行比较以找出答案。
“LAMPP”架构在这种情况下没有任何意义。
您可能应该考虑将您的网站迁移到云(例如亚马逊云)IT 将允许您硬件可扩展性,并且您只需为您使用的内容付费。
这样,您只需为实际使用的 CPU 时间、内存和带宽付费。
但在云中,低效的系统可能比优化的系统昂贵得多。但是,您不必担心您的网站会在一夜之间瘫痪。
First see how popular your site is going to be. Don't count your chickens before they are hatched ;). That said, watch the growth and address it with additional programming and hardware when it starts to get slow under peak loads.
You will need to go to a dedicated server before implementing memcached etc. A shared godaddy server will crumble very quickly under any appreciable load, and they are known to just shut you down without notice. Monitor your traffic well.
If the site wasn't built with scalability in mind, you will probably end up paying as much or more as you did to have the site developed to make it scale.
This is one reason why local developers are better in the long term, you can bring these types of concerns up in an informal conversation and have the architecture be planed for it. You either pay more now, or even more down the road.
Good luck.
edit
It is an impossible to know how many resources your application will take. Every site is different. It depends on the efficiency of the queries, etc.
I think go daddy has monitors on cpu, bandwidth, and memory for you to look at. You should use these and compare against your plan to figure it out.
"LAMPP" architecture has no meaning in this context.
You should probably think about moving your site over to a cloud (amazon cloud for example) IT will allow you hardware scalability, and you only pay for what you use.
That way you only pay for the cpu time memory and bandwidth you are actually using.
But an inefficient system can be much more expensive in the cloud than a optimized one. You don't, however, have to worry about your site going down overnight.