What do I have to do to make 20k mysql inserts per second possible (during peak hours around 1k/sec during slower times)? I've been doing some research and I've seen the "INSERT DELAYED" suggestion, writing to a flat file, "fopen(file,'a')", and then running a chron job to dump the "needed" data into mysql, etc. I've also heard you need multiple servers and "load balancers" which I've never heard of, to make something like this work. I've also been looking at these "cloud server" thing-a-ma-jigs, and their automatic scalability, but not sure about what's actually scalable.

我需要做些什么来实现每秒20k mysql插入(在高峰时段,在较慢的时间内大约1k /秒)?我一直在做一些研究,我已经看到了“INSERT DELAYED”建议,写入平面文件,“fopen(文件,'a')”,然后运行chron作业将“所需”数据转储到mysql等我也听说你需要多个服务器和“负载平衡器”,这是我从未听说过的,做这样的工作。我也一直在关注这些“云服务器”的东西,它们的自动可扩展性,但不确定实际可扩展性。

The application is just a tracker script, so if I have 100 websites that get 3 million page loads a day, there will be around 300 million inserts a day. The data will be ran through a script that will run every 15-30 minutes which will normalize the data and insert it into another mysql table.

该应用程序只是一个跟踪器脚本,所以如果我有100个网站每天可以获得300万次页面加载,那么每天将有大约3亿次插入。数据将通过一个每15-30分钟运行一次的脚本运行,该脚本将规范化数据并将其插入另一个mysql表中。

How do the big dogs do it? How do the little dogs do it? I can't afford a huge server anymore so any intuitive ways, if there are multiple ways of going at it, you smart people can think of.. please let me know :)

大狗怎么做?小狗怎么做的?我买不起大型服务器,所以任何直观的方式,如果有多种方式,你聪明的人可以想到..请让我知道:)

8 个解决方案

#1


5

How do the big dogs do it?

大狗怎么做?

Multiple servers. Load balancing.

多台服务器。负载均衡。

How do the little dogs do it?

小狗怎么做的?

Multiple servers. Load balancing.

多台服务器。负载均衡。

You really want to save up inserts and push them to the database in bulk. 20k individual inserts a second is a crapton of overhead, and simplifying that down to one big insert each second eliminates most of that.

您真的想要保存插入并将它们批量推送到数据库。 20k个单独插入一秒钟是头顶上的一个掠夺者,并且每秒插入一个大插入物就可以消除大部分内容。

更多相关文章

  1. 如何在PHP 5.4.33 Apache服务器上启用mbstring?
  2. 通过添加3hrs从服务器中重新获取CURTIME()并在PHP页面中显示它
  3. 显示长期运行的PHP脚本的进展。
  4. php和django位于同一个lighttpd服务器上
  5. 将node.js服务器更改为Apache服务器
  6. 当我将它移动到另一台服务器时,计数器将无法工作
  7. 在Capistrano任务中引用当前服务器
  8. PHP获取服务器端的相关信息
  9. PHP基础之脚本传参

随机推荐

  1. Android 预置APK的权限授予
  2. Windows系统下制作Android开关机动画
  3. android 屏幕上面画线
  4. Android使用NDK进行联网签名认证
  5. android官方资源下载url
  6. iOS与Android对比学之NSNotificationCent
  7. Android 启动app的几种方式
  8. Android(安卓)Studio里面的Build.gradle
  9. AES Crypto 在 Android P(Android 9.0) 被
  10. Android manifest属性总结