首页 \ 问答 \ Web应用程序接收数百万个请求,并导致在SQL Server 2008中每30秒生成数百万行插入(web application receiving millions of requests and leads to generating millions of row inserts per 30 seconds in SQL Server 2008)

Web应用程序接收数百万个请求,并导致在SQL Server 2008中每30秒生成数百万行插入(web application receiving millions of requests and leads to generating millions of row inserts per 30 seconds in SQL Server 2008)

我目前正在解决我们的Web应用程序每30秒至少收到一百万个请求的情况。 因此,这些请求将导致在5个表之间生成3-5百万行插入。 这是非常重要的负担。 目前我们正在使用多线程来处理这种情况(速度稍快但无法获得更好的CPU吞吐量)。 然而,未来负荷肯定会增加,我们也必须考虑到这一点。 从现在起6个月后,我们正在考虑我们目前正在接收的负载大小的两倍,我目前正在寻找一种可扩展的可能新解决方案,并且应该足够容易以适应此负载的任何进一步增加。 目前使用多线程我们正在使整个调试场景变得非常复杂,有时我们遇到跟踪问题的问题。

仅供参考我们已经在使用上一篇文章中提到的SQL Builk插入/复制

Sql server 2008 - 用于插入大量数据的性能调整功能

但是我正在寻找能够解决这种情况的更有能力的解决方案(我认为应该有一个)。

注意:我不是在寻找任何代码片段或代码示例。 我只是在寻找一个我可以使用的概念的大图,我相信我可以进一步采用优雅的解决方案:)

此外,解决方案应该更好地利用线程和进程。 而且我不希望我的线程/进程因为其他资源而等待执行某些事情。

任何建议都将深表感谢。

更新 :并非每个请求都会导致插入...但是大多数请求都会导致一些SQL操作。 应用程序执行不同类型的事务,这将导致大量的批量SQL操作。 我更关注插入和更新。 并且这些操作不需要是实时的,可能会有一点滞后......但是实时处理它们会非常有用。


I am currently addressing a situation where our web application receives at least a Million requests per 30 seconds. So these requests will lead to generating 3-5 Million row inserts between 5 tables. This is pretty heavy load to handle. Currently we are using multi threading to handle this situation (which is a bit faster but unable to get a better CPU throughput). However the load will definitely increase in future and we will have to account for that too. After 6 months from now we are looking at double the load size we are currently receiving and I am currently looking at a possible new solution that is scalable and should be easy enough to accommodate any further increase to this load. Currently with multi threading we are making the whole debugging scenario quite complicated and sometimes we are having problem with tracing issues.

FYI we are already utilizing the SQL Builk Insert/Copy that is mentioned in this previous post

Sql server 2008 - performance tuning features for insert large amount of data

However I am looking for a more capable solution (which I think there should be one) that will address this situation.

Note: I am not looking for any code snippets or code examples. I am just looking for a big picture of a concept that I could possibly use and I am sure that I can take that further to an elegant solution :)

Also the solution should have a better utilization of the threads and processes. And I do not want my threads/processes to even wait to execute something because of some other resource.

Any suggestions will be deeply appreciated.

Update: Not every request will lead to an insert...however most of them will lead to some sql operation. The appliciation performs different types of transactions and these will lead to a lot of bulk sql operations. I am more concerned towards inserts and updates. and these operations need not be real time there can be a bit lag...however processing them real time will be much helpful.


原文:https://stackoverflow.com/questions/5584671
更新时间:2023-10-07 17:10

最满意答案

Cloud Functions无法像以前一样大规模扩展, 并且仍然在本地读取数据库。 为您的功能启动的每个服务器实例都是该功能的独立环境。 如果您的功能访问实时数据库或Firestore,它将通过Google的内部网络执行此操作。

如果您对性能有所顾虑,则应根据您的预期情况对其进行基准测试。 没有人可以做出任何猜测,如果它没有一些具体的数据可以“足够快”。


There is no way that Cloud Functions could scale massively as it does and still read your database locally. Each server instance that's spun up for your functions is an isolated environment for that function. If your function accesses Realtime Database or Firestore, it will be doing so over Google's internal networks.

If you have concerns about performance, you should benchmark it according to your expected situation. No one can make any guesses if it's going to be "fast enough" without some concrete data to work with.

相关问答

更多

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)