Netcat – socket in time_wait when echoing and piping, but not when invoked directly

I’m testing an application using netcat (nc) and I’m getting very low throughput on network connections. When I ran netstat -tnpo I see numerous TCP sessions in TIME_WAIT. I’m sending data to my application via a bash script as indicated below: while true; do echo “<required string>” | nc server_ip port done If I instead … Read more

Debian/Apache Server waiting time very slow only with Chrome

I have a website running on a Linux Debian Squeeze server with Apache 2. The website is the only one on the server and the traffic to the website is very low (800-1000 connection per day). The problem is that when I run the website on Chrome the “Wait” time is very long (1 min, … Read more

How to configure for many stateless requests?

I am a data scientist / machine learning developer. Sometimes, I have to expose my models by providing an endpoint. I usually do this via Flask and gunicorn: exampleproject.py: import random from flask import Flask app = Flask(__name__) random.seed(0) @app.route(“/”) def hello(): x = random.randint(1, 100) y = random.randint(1, 100) return str(x * y) if … Read more

Why is server is waiting with second request untill first is fisnished

Not sure what it is, but everytime I try to run one http request from browser, second must wait for first to fisnish. Is it server side configuration/seciurirty? For example, I have 2 files long.php and short.php. After making request to long.php one I totally cannot open short.php. After long.php is finished, short.php is then … Read more

How to check on CentOS 7.7 which process take 1 min because of slow page loading (TTFB 1 min)

I’m using CentOS version 7.7. A few days ago my frontend page (not whole website) TTFB is exactly 1 min. How I can check which process causes that? I’m using PHP 7.3 php-fpm ON Any way to check which process cause waiting for the first byte 60 seconds? https://i.stack.imgur.com/sYGze.png This error I got a few … Read more

PHP Adodb many sleeping connections

Already asked the question on stackoverflow but i guess this might be a better place for it. I’m currently struggeling with a strange problem: while using adodb as connection layer for php, it leaves many sleeping and unneeded connections behind. wait_timeout is set to 20 but there are still plenty (~100) of sleeping connections due … Read more

Limiting outgoing connections by port to control nf_conntrack usage

I would like to make my system more resilient against certain failure. When the system makes rapid outbound TCP connections fail, the nf_conntrack table fills up with TIME_WAIT entries. This causes other operations on the system to fail as there are no more nf_conntrack entries available. I know that it is possible to modify certain … Read more