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)

 

Data obtained from ping: is it round trip or one way?的更多相关文章

  1. [Compose] Isomorphisms and round trip data transformations

    What is Isomorphisms?We have a value x, then apply function 'to' and 'from' to value 'x', the result ...

  2. Round trip 流程图

    更多原创测试技术文章同步更新到微信公众号 :三国测,敬请扫码关注个人的微信号,感谢!

  3. linux ping 命令解析

    不管在windows平台,还是在linux平台,ping都是非常常用的网络命令:ping命令通过ICMP(Internet控制消息协议)工作:ping可以用来测试本机与目标主机是否联通.联通速度如何. ...

  4. Linux下实现ping功能

    实现ping功能,就肯定要用到ping命令,那么在Linux下ping命令为: ping [-dfnqrRv][-c<完成次数>][-i<间隔秒数>][-I<网络界面&g ...

  5. Linux下ping命令参数详细解析

    -a Audible ping. #Audible ping. -A Adaptive ping. Interpacket interval adapts to round-trip time, so ...

  6. Linux命令ping

    原文 ping命令用来测试主机之间网络的连通性.执行ping指令会使用ICMP传输协议,发出要求回应的信息,若远端主机的网络功能没有问题,就会回应该信息,因而得知该主机运作正常. 语法 ping(选项 ...

  7. 【Shell】总结·linux shell脚本攻略

    第一章:小试牛刀 #变量赋值 var = value不同于var=value 把var=value写成var = value是一个常见的错误 前者是赋值操作,后者是相等操作 #let命令可以直接执行基 ...

  8. [转]ping检测网络连接异常

    转载地址:http://blog.csdn.net/feizxiang3/article/details/26672781 一般来说当出现网络无法连接时,习惯性的用ping命令来ping某个ip地址, ...

  9. 介绍ping中的TTL是什么意思

    ping是icmp报文的一种应用.用来测试网络中各设备的连通性.在这几天的实验课上,我又用到了这个非常常用的命令,但是这次我发现了一些以前没有太注意的地方,那就是我在Ping不同的地址时所返回的TTL ...

随机推荐

  1. 通俗理解 模糊自适应PID

    模糊自适应PID算法就是在经典的PID的基础上添加模糊控制规则库,建立这个库的目的就是算法能够自己来进行改变P.I.D的值. 就拿温度的上升过程控制来说,刚开始的时候,希望温度能够快速的升到终点温度, ...

  2. BZOJ3940: [Usaco2015 Feb]Censoring (AC自动机)

    题意:在文本串上删除一些字符串 每次优先删除从左边开始第一个满足的 删除后剩下的串连在一起重复删除步骤 直到不能删 题解:建fail 用栈存当前放进了那些字符 如果可以删 fail指针跳到前面去 好菜 ...

  3. Sql Server 中锁的概念(1)

    Sql Server 中锁的概念   锁的概述 一. 为什么要引入锁 多个用户同时对数据库的并发操作时会带来以下数据不一致的问题: 丢失更新A,B两个用户读同一数据并进行修改,其中一个用户的修改结果破 ...

  4. 框架—Mybatis搭建

    1:导包 完整jar包:mybatis核心包+依赖包+mysqljdbc驱动包 2. 建库建表 3.实体类 4.映射文件 一般dao的包下 5.主配置文件(mybatisconfig.xml) 一般s ...

  5. Maven实战读书笔记(二):Maven坐标与仓库

    2.1 Maven坐标 Maven坐标是Maven用来表示一个组件依赖的标示. Maven通过下面几个元素定义坐标:groupId.artifactId.version.packaging.class ...

  6. In line copy and paste to system clipboard

    On the Wiki Wiki Activity Random page Videos Photos Chat Community portal To do    Contribute  Watch ...

  7. python读取excel学习(1)

    #coding=gbk #coding=utf-8 import xlrd table = xlrd.open_workbook(r'E:\test.xlsx') #sheet = table.she ...

  8. shiro框架的四中权限控制方式

    https://www.cnblogs.com/cocosili/p/7103025.html 一.在自定义的realm中进行权限控制 在applicationContext.xml文件中添加  /a ...

  9. [Android]使用button切换TextView可见和不可见

    <Button android:id="@+id/btnTest" android:layout_width="match_parent" android ...

  10. JSP指令学习

    JSP 指令 JSP指令用来设置整个JSP页面相关的属性,如网页的编码方式和脚本语言.语法格式: <%@ page attribute="value"%> 指令可以有很 ...