dongshi1424 2012-04-18 20:16
浏览 58
已采纳

生成对时间敏感的Web应用程序的统计信息

We're running a very time-sensitive web application (response time has to be below 100ms), with a lot of requests (about 200k requests per minute at peak). The architecture is really simple: a load balancer, several web servers, running apache and php, and a database running MySQL.

We also need to be able to generate statistics based on those requests.

About a year ago when we were serving a tenth of our current traffic volume, we developed some bash/python scripts to periodically dump the logs from mysql, trasnfer them to another server, import them again and run the statistics there, the idea being to have the production servers do as little as possible so that we could have a low response time.

As you might imagine, that solution didn't scale very well, and at the moment, the stat server is barely keeping up. We need a way to generate statistics in real time.

Do you have any experiences with this kind of a setup? Our idea at the moment is to have the web servers call the stats servers in real time on each request.

The two main problems are:

  • how should we approach this so that the response time doesn't increase too much
  • the stats server or server has to handle all the requests from all the webheads / or it needs to be able to scale horizontally.
  • 写回答

2条回答 默认 最新

  • dsfsdfsdfsdfsdf45454 2012-04-18 20:21
    关注

    Why use a database? Calculate mean and standard deviation in memory on the fly as requests come in. You won't have any latency that way, and you can have access to values using an MBean console.

    This can only work on an individual server, not a cluster.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 三因素重复测量数据R语句编写,不存在交互作用
  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表