Recently, there was an issue with a curl command that ran a script with php. The curl command would finish after a lengthy time as before it was completing within seconds.

The issue turned out to be that the command was using the IPV6 connection where in the data center the IPV6 was not active.

This was discovered with the -v option in curl.

curl -v ""
/* About to connect() to port 443 (#0)
/* Trying 2a09:2980:f0ee:a:fabe:b50c:0:2...
/* Connection timed out
/* Trying

As you can see – the IPV6 address times out. The solution is to disable IPV6 in the network setting for the Ethernet card.

Subnet to Mask Bits conversion table
Mask CIDR Length (Mask Bits) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

How to test apache.

Create 2 files:

Create a php file testload.php that checks the existence of another file named test.php in the same directory of two CentOS 7 servers with the same hardware characteristics and load but with different MPM. One of them will use event and the other one will use prefork.

<!--?php $filename = 'test.php'; if (file_exists($filename)) { echo "The file $filename exists"; } else { echo "The file $filename does not exist"; } ?-->

With ab, we will sent 50 (-c 50) concurrent requests at the same time and repeat the test 1000000 times

# ab -c 50 -n 100000 http://localhost/testload.php

200 simultaneous requests until 2000 requests are completed:

# ab -k -c 100 -n 2000 localhost/testload.php

Another test to localhost

]# ab -c 50 -n 100000 http://localhost/index.html
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd,
Licensed to The Apache Software Foundation,

Benchmarking localhost (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests

Server Software:        Apache/2.4.6
Server Hostname:        localhost
Server Port:            80

Document Path:          /index.html
Document Length:        15167 bytes

Concurrency Level:      50
Time taken for tests:   3596.808 seconds
Complete requests:      34570
Failed requests:        0
Write errors:           0
Non-2xx responses:      34571
Total transferred:      537122767 bytes
HTML transferred:       524331497 bytes
Requests per second:    9.61 [#/sec] (mean)
Time per request:       5202.210 [ms] (mean)
Time per request:       104.044 [ms] (mean, across all concurrent requests)
Transfer rate:          145.83 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       3
Processing:   213 5198 241.5   5203   10154
Waiting:      174 4428 227.6   4435    9302
Total:        214 5198 241.5   5203   10154

Percentage of the requests served within a certain time (ms)
  50%   5203
  66%   5264
  75%   5302
  80%   5327
  90%   5391
  95%   5449
  98%   5532
  99%   5617
 100%  10154 (longest request)

The term hairpinning comes from the fact that the traffic comes from one source into a router or similar devices, makes a U-turn and goes back the same way it came.

Visualize this and you see something that looks like a hairpin.

Hairpin NAT is a useful technique for accessing an internal server using a public IP. Since you are using a public IP to attempt to access a server in your network, the traffic will attempt to go out to the internet. In order to reach the server, the traffic will need to be redirected to the correct location.
The issue with this article is that you need to load a website or use curl to access the website on an internal IP that is set up as NAT to a public IP.


Server1 – Web Server. Has a public IP and is behind a firewall with the private IP

When you try and load the site on this server, it does not load.
Fix: Set up hosts file to point to the private IP.

Use this information when changing the hostname in centos 7.

Ways to show the hostname

# hostname
# hostname -s
# hostname -f
# cat /etc/hostname
# hostnamectl

How to change the hostname.
In order to change or set a CentOS 7 machine hostname, use the hostnamectl command as shown in the below command excerpt.

# hostnamectl set-hostname your-new-hostname

In order to apply the new hostname, a system reboot is required, issue one of the below commands in order to reboot a CentOS 7 machine.

# init 6
# systemctl reboot
# shutdown -r now

A second method to setup a CentOS 7 machine hostname is to manually edit the /etc/hostname file

# nano /etc/hostname

When booting an Azure VM, this error:

304.863321] —[ end Kernel panic – not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

Solution: remove old linux kernels, your /boot drive is out of space.

-boot to grub and click on “Advanced options”
-Select a previous kernel (should boot fine)
login and enter command

$ df

See if your /boot directory is 100% used
Remove old linux kernels

$ sudo apt-get autoremove

Also, there may be an issue with the storage drivers (that should be built into initramfs) needed for Hyper-V / Azure.
Other Information: