Bug #78825 [Com]: stream_socket_client works slower than except

From: Date: Mon, 18 Nov 2019 19:41:52 +0000
Subject: Bug #78825 [Com]: stream_socket_client works slower than except
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-223787@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78825&edit=1

 ID:                 78825
 Comment by:         vibbow at hotmail dot com
 Reported by:        vibbow at hotmail dot com
 Summary:            stream_socket_client works slower than except
 Status:             Assigned
 Type:               Bug
 Package:            Performance problem
 Operating System:   Windows Server 2019
 PHP Version:        7.3.11
 Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

I'm using minimum PHP config to reproduce this issue:

By copy php.ini-production config file with add following two lines:

extension_dir = ".\ext\"
extension = sockets


Previous Comments:
------------------------------------------------------------------------
[2019-11-18 19:26:56] vibbow at hotmail dot com

I tried to reproduce this issue on 4 different environment, 3 environment can reproduce this issue,
1 environemtn can't reproduce this issue.

First I enhanced the test script a little bit, so I can see the overall trend.
https://gist.github.com/vibbow/8909ffc9990023129562e8971fe30f7d

This script will return four number at end of test:
1000 | 0 | 239 | 761
1st and 2nd number are latency below & above 5ms when using socket_create
3rd and 4th number are latnecy below & avobe 5ms when using stream_socket_client

Next is my four enviroment and test results:

 - First environment:
Two Physical Machine
Machine One
    Running Windows 10 1909 x64 (Agent A)
Machine Two
    Running Windows Server 2019 with Hyper-V enabled (Agent B)
    Running Ubuntu Server 19.10 as Hyper-V Guest (Agent C)

Result:
Agent A -> Agent C
    992 | 8 | 157 | 843
Agent B -> Agent C
    1000 | 0 | 106 | 894
Agent B -> Agent A
    994 | 6 | 53 | 947


- Second environment:
One Physical Machine
Machine One:
    Running VMware ESXi 6.7
    Running Windows Server 2019 as ESXi Guest (Agent A)
    Running Ubuntu Server 18.04 as ESXi Guest (Agent B)

Result:
Agent A -> Agent B
    1000 | 0 | 239 | 761


- Third environment:
One Physical Machine
Machine One:
    Running Windows 10 LTSC 2019 with Hyper-V Enabled (Agent A)
    Running Ubuntu Server 18.04 as Hyper-V Guest (Agent B)

Result:
Agent A -> Agent B
    1000 | 0 | 23 | 977


- Fourth environment:
Two VIRTUAL machine (on vultr.com)
VM1: Windows Server 2019 (Agent A)
VM2: Ubuntu Server 19.04 (Agent B)

Result:
Agent A -> Agent B
    999 | 1 | 1000 | 0

------------------------------------------------------------------------
[2019-11-18 15:22:30] vibbow at hotmail dot com

That'e weird, I can consistent reproduce this issue.


I'll try to replicate my environment on a cloud server and try again.

------------------------------------------------------------------------
[2019-11-18 12:35:42] cmb@php.net

Hmm, I cannot reproduce this when connecting to another machine on
the same network, where one runs Windows 10 1903 and the other
Windows 10 1909 (tested both directions).  Tested with PHP 7.3.11
x64 NTS.

------------------------------------------------------------------------
[2019-11-17 13:48:24] vibbow at hotmail dot com

It can also be reproduced on Windows Server 2019

------------------------------------------------------------------------
[2019-11-17 13:44:24] vibbow at hotmail dot com

I can get this reproduced on:

Windows 10 1909 x64

PHP 7.3.11 x64 nts
PHP 7.3.1 x64 nts
PHP 7.2.9 x64 nts
PHP 5.6.9 x64 nts

If stream_socket_client connect to a local interface ip address, then everything works fine.

It can only reproduced by connect to another PC on same network.

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


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=78825


--
Edit this bug report at https://bugs.php.net/bug.php?id=78825&edit=1


Thread (24 messages)

« previous php.bugs (#223787) next »