keep-alive

Is http keep-alive effective with different domain on the same webserver?

北城余情 提交于 2019-12-12 02:45:53
问题 On the same nginx/apache server: Scene 1: a.test.com and b.test.com can use keep-alive? Scene 2: localhost and 127.0.0.1 can use keep-alive? or the "Host header" must be consistent and the keep-alive will effective? 回答1: For Apache it looks like it's based on IP address rather than host header, though I guess it also very much depends on client implementation. https://httpd.apache.org/docs/2.4/vhosts/details.html#hostmatching Persistent connections The IP lookup described above is only done

Safest way to stop a node instance

淺唱寂寞╮ 提交于 2019-12-12 01:48:28
问题 I have a very busy web application: Nginx as the "front", acting as a reverse proxy Node server running on unprivileged ports, queried by Nginx The application uses websockets (one socket open for each client). Nginx is configured in a very typical fashion: server { listen X.Y.255.3:443 ssl http2; server_name example.com; client_max_body_size 0; ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; ssl_trusted_certificate /etc/letsencrypt/live/example.com/chain.pem; ssl_certificate

记一次vue 的keep-alive踩坑之路 —— active和deactivated()函数不执行

馋奶兔 提交于 2019-12-11 16:21:11
现象:路由頁面被缓存,销毁阶段函数不执行,active和deactivated()函数不执行,进入页面的created函数(创建期函数)执行。 原因: <template> <div id="app"> <keep-alive v-if="$route.meta.keepAlive"> <div> //未激活 <router-view :class="this.$route.meta.requireAuth===true?'':'tab-bottom'"/> </div> </keep-alive> <div> <template> 改正: <template> <div id="app"> <keep-alive v-if="$route.meta.keepAlive"> <router-view :class="this.$route.meta.requireAuth===true?'':'tab-bottom'"/> </keep-alive> <div> <template> <keep-alive> 正常生效条件: 1.只能包裹动态组件,不能包裹 div 等标签,要想保持状态,就得把那部分封装在一个功能性的组件上。 2.keep-alive仅支持第一个元素,单节点激活。 3.一个keep-alive只能在同一时间段内保持一个组件状态,也就是里面不能有两个动态组件 4

How to set keep-alive timer in python 2.5 running in Windows 7

橙三吉。 提交于 2019-12-11 08:54:40
问题 I need some help. I'm working on a legacy software that uses python 2.5.4 running on Windows7 and I need to enable keepalives in my socket connection. I've seen in the thread below that you can enable keepalives in python using object.setsockopt( socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) However this setup uses the default windows keep alive timer of 2 hours. I've also seen that we can set the timer using the following API, however it is only available for Python 2.6 onwards. sock.ioctl

How to configure apache with active passive setup

和自甴很熟 提交于 2019-12-11 08:51:45
问题 I have two servers both having Apache httpd with identical configurations Server1 and Server2. I want to create active and passive setup for these servers. Server1(lbserver.my.com) IP:192.168.10.88 (Active) Server2(lbserver.my.com) IP:192.168.10.89 (Passive) Server1 should respond to http requests. In case Server1 goes down then Server2 should become Active server and respond to http requests. Can anyone suggest how to achieve this. I tried this with keepalived configured on both the servers

How to make a HTTP persistent connection with server using AFNetworking library

岁酱吖の 提交于 2019-12-11 07:24:52
问题 Can anyone please point me in the right direction in making a HTTP persistent connection with server using AFNetworking library. I've already looked at the following code: NSURL *URL = [NSURL URLWithString:@"http://example.com"]; AFRocketClient *client = [[AFRocketClient alloc] init]; [client SUBSCRIBE:@"/resources" usingBlock:^(NSArray *operations, NSError *error) { for (AFJSONPatchOperation *operation in operations) { switch (operation.type) { case AFJSONAddOperationType: [resources

TCP Keep-Alive PDO Connection Parameter

徘徊边缘 提交于 2019-12-11 05:28:26
问题 Does PHP's PDO (or it's respective PostgreSQL driver) have a connection configuration option for enabling a TCP keep-alive probe like JDBC? I'm experiencing an issue where we're making a connection through a NAT which drops connections after 5 minutes (I can't change this), and the query we're running on an external Postgres instance takes longer than 5 minutes to run, causing our client to never receive a response from the Postgres instance and eventually time out. 回答1: The PDO PostgreSQL

How to implement TCP KeepAlive in VB.NET on a TCP Client(socket)

余生长醉 提交于 2019-12-11 03:32:40
问题 I want to implement the TCP KeepAlive in order to check dropped connections by running a timer. In my case, I have a TCP Client (using socket class) and a third party server (i have no control on it). How can i use the TCP KeepAlive on my TCP Client in order to check the connection state? For the moment i have enabled the TCP KeepAlive option! tcpsocket.Connect(IPEndPoint) tcpSocket.SetSocketOption(SocketOptionLevel.Tcp,SocketOptionName.KeepAlive,1); Searching on the internet i have found

震惊!线上四台机器同一时间全部 OOM,到底发生了什么?

假装没事ソ 提交于 2019-12-11 00:17:45
案发现场 昨天晚上突然短信收到 APM (即 Application Performance Management 的简称,我们内部自己搭建了这样一套系统来对应用的性能、可靠性进行线上的监控和预警的一种机制)大量告警 (画外音: 监控是一种非常重要的发现问题的手段,没有的话一定要及时建立哦) 紧接着运维打来电话告知线上部署的四台机器全部 OOM (out of memory, 内存不足),服务全部不可用,赶紧查看问题! 问题排查 首先运维先重启了机器,保证线上服务可用,然后再仔细地看了下线上的日志,确实是因为 OOM 导致服务不可用 第一时间想到 dump 当时的内存状态,但由于为了让线上尽快恢复服务,运维重启了机器,导致无法 dump 出事发时的内存。所以我又看了下我们 APM 中对 JVM 的监控图表 画外音: 一种方式不行,尝试另外的角度切入!再次强调,监控非常重要!完善的监控能还原当时的事发现场,方便定位问题。 不看不知道,一看吓一跳,从 16:00 开始应用中创建的线程居然每时每刻都在上升,一直到 3w 左右,重启后(蓝色箭头),线程也一直在不断增长),正常情况下的线程数是多少呢,600!问题找到了,应该是在下午 16:00 左右发了一段有问题的代码,导致线程一直在创建,且创建的线程一直未消亡!查看发布记录,发现发布记录只有这么一段可疑的代码 diff:在

Apache: Get rid of Keep-Alive entry in the headers list

北城以北 提交于 2019-12-10 20:04:21
问题 I'm using LAMP (Linux, Apache, MySQL, PHP) server. Currently the server sends the response with next Headers list. I want to eliminate Keep-Alive entry for security reasons, to have Headers list without it. Is it possible to prevent sending the Keep-Alive entry in the Headers list? Current Response Headers: Cache-Control private, no-cache, no-store, must-revalidate, post-check=0, pre-check=0 Connection Keep-Alive Content-Encoding gzip Content-Type text/html; charset=UTF-8 Date Thu, 13 Mar