I have 2 servers, each in two separate locations. I need to host an application on one, and the database server on the other.

From the app server, if I ping the database server, on average I get about 30ms.

My question is:

  When I query the database from the app;

  Is it going to take 30 ms + database_server_query_run_time

  Or;

  Is it going to take 30 ms + database_server_query_run_time + 30ms

I would like to understand this please.

------------------------------------------------------------------------------------------

It will usually take more then those two options.

Ping measures just the time from client, to server, and back again (rtt - round trip time)

Usually databases use TCP, so you first need to send a SYN packet to start the TCP handshake (to simplify let's say 15ms* + cpu time, then you recieve and SYN/ACK (15ms+cpu time), send back an ACK and a request (atleast 15ms + cpu time), then the time for the DB to process the query, and then the time (15ms + cpu) to get the data back, and a bit more to ack, and close the connection.

This is ofcourse not counting the authentication (username/password) to the database, and no encryption (ssl handshakes/DH or whatever is needed).

*half of a round trip time, assuming the route there and back is symmetrical (half the time to get there, and half to get back... cpu processing time for ping reply is very short)

 

最新文章

  1. 超级小的web手势库AlloyFinger发布
  2. int->string-------------c
  3. C#将dll打包到程序中
  4. CodeBlocks背景主题的设置
  5. JTable的DefaultModel方法getValueAt(a,row)
  6. 网络处理2-异步POST请求和同步请求
  7. Android知识思维导图
  8. 24种设计模式--装饰模式【Decorator Pattern】
  9. [译] 新手和老手都将受益的JavaScript小技巧
  10. 行业百科知识--Github
  11. Database Connection Pool Library | Libzdb
  12. (转载)python日期函数
  13. Java并发之底层实现原理学习笔记
  14. 粒子系统属性Life,发射速率和总数的关系
  15. mongodb 笔记
  16. SpringBoot系列 - 集成JWT实现接口权限认证
  17. 2017-2018-2 20165231 实验四 Android程序设计
  18. .net跨防火墙链接oracle连接池链接长时间无通讯数据被断开后报错问题解决
  19. 浅谈分词算法(3)基于字的分词方法(HMM)
  20. unity3d-代码控制游戏角色控制器移动

热门文章

  1. 【整理】 vue-cli 打包后显示favicon.ico小图标
  2. Open Cascade创建自己的MFC文档程序
  3. Ubuntu下压缩与解压各种文件的命令
  4. 如何用纯 CSS 创作一个 3D 文字跑马灯特效
  5. HTML5表单新增元素与属性
  6. TeeChart Pro VCL/FMX教程之使用函数
  7. 洛谷 P1938 [USACO09NOV] 找工就业Job Hunt
  8. mongodb 的创建和使用
  9. URAL 1277 Cops and Thieves
  10. POJ-3100-Root of the Problem,原来是水题,暴力求解~~~