Flask API server slow response time - gunicorn

I created an API server with Flask, I use gunicorn with eventlet to run it. I noticed a long response time from Flask server when calling APIs. I did a profiling with my client, one ran from my laptop, one ran directly in Flask API server.
From my laptop:
302556 function calls (295712 primitive calls) in 5.594 seconds
Ordered by: internal time
ncalls tottime percall cumtime percall filename:lineno(function)
72 4.370 0.061 4.370 0.061 {method 'poll' of 'select.epoll' objects}
16 0.374 0.023 0.374 0.023 {method 'connect' of '_socket.socket' objects}
16 0.213 0.013 0.213 0.013 {method 'load_verify_locations' of '_ssl._SSLContext' objects}
16 0.053 0.003 0.058 0.004 httplib.py:798(close)
52 0.034 0.001 0.034 0.001 {method 'do_handshake' of '_ssl._SSLSocket' objects}
On server:
231449 function calls (225936 primitive calls) in 3.320 seconds
Ordered by: internal time
ncalls tottime percall cumtime percall filename:lineno(function)
12 2.132 0.178 2.132 0.178 {built-in method read}
13 0.286 0.022 0.286 0.022 {method 'poll' of 'select.epoll' objects}
12 0.119 0.010 0.119 0.010 {_ssl.sslwrap}
12 0.095 0.008 0.095 0.008 {built-in method do_handshake}
855/222 0.043 0.000 0.116 0.001 sre_parse.py:379(_parse)
1758/218 0.029 0.000 0.090 0.000 sre_compile.py:32(_compile)
1013 0.027 0.000 0.041 0.000 sre_compile.py:207(_optimize_charset)
12429 0.023 0.000 0.029 0.000 sre_parse.py:182(__next)
So, I saw my client took long time to wait from server response base on the profile result.
I used gunicorn with eventlet to serve Flask app, with the flowing configuration:
import multiprocessing
bind = ['0.0.0.0:8000']
backlog = 2048
workers = multiprocessing.cpu_count() * 2 + 1
worker_class = 'eventlet'
user = 'www-data'
group = 'www-data'
loglevel = 'info'
My client is an custom HTTP client using eventlet to patch httplib2 and create a pool to connect to server.
I stuck here with the troubleshooting. All server stats were normal. How can I detect the bottle neck of my API server?

Related

qemu kvm vm can't access network with ovs dpdk

i'm using ovs with dpdk to improve network performance, but i can't resolve the problem by my self
DPDK dev bind script output
# dpdk-devbind.py -s
Network devices using DPDK-compatible driver
============================================
0000:07:00.0 'I350 Gigabit Network Connection 1521' drv=igb_uio unused=igb,vfio-pci,uio_pci_generic
0000:07:00.1 'I350 Gigabit Network Connection 1521' drv=igb_uio unused=igb,vfio-pci,uio_pci_generic
Network devices using kernel driver
===================================
0000:01:00.0 'Ethernet Controller 10-Gigabit X540-AT2 1528' if=eno1 drv=ixgbe unused=igb_uio,vfio-pci,uio_pci_generic *Active*
0000:01:00.1 'Ethernet Controller 10-Gigabit X540-AT2 1528' if=eno2 drv=ixgbe unused=igb_uio,vfio-pci,uio_pci_generic
No 'Baseband' devices detected
==============================
No 'Crypto' devices detected
============================
No 'Eventdev' devices detected
==============================
No 'Mempool' devices detected
=============================
No 'Compress' devices detected
==============================
No 'Misc (rawdev)' devices detected
===================================
ovs config
# ovs-vsctl --no-wait get Open_vSwitch . other_config
{dpdk-init="true", dpdk-lcore-mask="0x6", pmd-cpu-mask="0x24"}
cpu info
# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 46 bits physical, 48 bits virtual
CPU(s): 24
On-line CPU(s) list: 0-23
Thread(s) per core: 2
Core(s) per socket: 6
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 62
Model name: Intel(R) Xeon(R) CPU E5-2630 v2 # 2.60GHz
Stepping: 4
CPU MHz: 2965.447
CPU max MHz: 3100.0000
CPU min MHz: 1200.0000
BogoMIPS: 5199.97
Virtualization: VT-x
L1d cache: 384 KiB
L1i cache: 384 KiB
L2 cache: 3 MiB
L3 cache: 30 MiB
NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22
NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23
Vulnerability Itlb multihit: KVM: Mitigation: Split huge pages
Vulnerability L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Vulnerability Mds: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Meltdown: Mitigation; PTI
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Full generic retpoline, IBPB conditional, IBRS_FW, STIBP conditional, RSB filling
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx es
t tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm cpuid_fault pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt dtherm ida arat pln pts md_clear flush_l1d
hugepage info
# grep Huge /proc/meminfo
AnonHugePages: 1214464 kB
ShmemHugePages: 0 kB
FileHugePages: 0 kB
HugePages_Total: 8192
HugePages_Free: 5846
HugePages_Rsvd: 1488
HugePages_Surp: 0
Hugepagesize: 2048 kB
Hugetlb: 16777216 kB
vm startup script
/usr/bin/qemu-system-x86_64 \
-enable-kvm \
-cpu host,kvm=off \
-smp 4 \
-m 8192M \
-object memory-backend-file,id=mem,size=1G,mem-path=/dev/hugepages,share=on \
-mem-prealloc \
-chardev socket,id=char-vm-2004-tpl,path=/var/run/openvswitch-vhost/vhost-vm-2004-tpl,server \
-netdev type=vhost-user,id=net-vm-2004-tpl,chardev=char-vm-2004-tpl,vhostforce \
-device virtio-net-pci,mac=52:54:14:cb:ab:6c,netdev=net-vm-2004-tpl \
-drive file=/opt/image/ubuntu-2004-tpl.img,if=virtio \
-vga qxl \
-spice port=15937,disable-ticketing \
-qmp tcp:0.0.0.0:25937,server,nowait \
-daemonize
ovs status
# ovs-vsctl show
2a4487e3-124a-4b66-92e1-1e824fd9a138
Bridge br0
datapath_type: netdev
Port vhost-vm-2004-tpl
Interface vhost-vm-2004-tpl
type: dpdkvhostuserclient
options: {vhost-server-path="/var/run/openvswitch-vhost/vhost-vm-2004-tpl"}
Port dpdk-p0
Interface dpdk-p0
type: dpdk
options: {dpdk-devargs="0000:07:00.0"}
Port br0
Interface br0
type: internal
ovs_version: "2.14.90"
ovs OpenFlow status
# ovs-ofctl show br0
OFPT_FEATURES_REPLY (xid=0x2): dpid:0000ecf4bbe2f494
n_tables:254, n_buffers:0
capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst
1(dpdk-p0): addr:ec:f4:bb:e2:f4:94
config: 0
state: 0
current: 1GB-FD AUTO_NEG
speed: 1000 Mbps now, 0 Mbps max
2(vhost-vm-2004-t): addr:00:00:00:00:00:00
config: 0
state: LINK_DOWN
speed: 0 Mbps now, 0 Mbps max
LOCAL(br0): addr:ec:f4:bb:e2:f4:94
config: 0
state: 0
current: 10MB-FD COPPER
speed: 10 Mbps now, 0 Mbps max
OFPT_GET_CONFIG_REPLY (xid=0x4): frags=normal miss_send_len=0
the vm can't get ip address by dhcp, and when i run command " ip link set ens3 up " on the vm,
it tell me "RTNETLINK answers: Operation not permitted"
the kernel version of host is
5.4.0-52-generic #57-Ubuntu SMP Thu Oct 15 10:57:00 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
the kernel version of vm is
5.4.0-47-generic #51-Ubuntu SMP Fri Sep 4 19:50:52 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
DPDK version:
DPDK 19.11.5
open vSwitch version:
2.14.90 (commit id:93023e80bd13ec1f09831eba484cf4621582d1a5 of https://github.com/openvswitch/ovs branch master)
ovs full log
2020-10-27T17:46:36.950Z|00001|vlog|INFO|opened log file /usr/local/var/log/openvswitch/ovs-vswitchd.log
2020-10-27T17:46:36.982Z|00002|ovs_numa|INFO|Discovered 12 CPU cores on NUMA node 1
2020-10-27T17:46:36.982Z|00003|ovs_numa|INFO|Discovered 12 CPU cores on NUMA node 0
2020-10-27T17:46:36.982Z|00004|ovs_numa|INFO|Discovered 2 NUMA nodes and 24 CPU cores
2020-10-27T17:46:36.983Z|00005|reconnect|INFO|unix:/usr/local/var/run/openvswitch/db.sock: connecting...
2020-10-27T17:46:36.983Z|00006|reconnect|INFO|unix:/usr/local/var/run/openvswitch/db.sock: connected
2020-10-27T17:46:36.985Z|00007|dpdk|INFO|Using DPDK 19.11.5
2020-10-27T17:46:36.985Z|00008|dpdk|INFO|DPDK Enabled - initializing...
2020-10-27T17:46:36.985Z|00009|dpdk|INFO|No vhost-sock-dir provided - defaulting to /usr/local/var/run/openvswitch
2020-10-27T17:46:36.985Z|00010|dpdk|INFO|IOMMU support for vhost-user-client disabled.
2020-10-27T17:46:36.985Z|00011|dpdk|INFO|POSTCOPY support for vhost-user-client disabled.
2020-10-27T17:46:36.985Z|00012|dpdk|INFO|Per port memory for DPDK devices disabled.
2020-10-27T17:46:36.985Z|00013|dpdk|INFO|EAL ARGS: ovs-vswitchd -c 0x6 --socket-mem 1024,1024 --socket-limit 1024,1024.
2020-10-27T17:46:36.988Z|00014|dpdk|INFO|EAL: Detected 24 lcore(s)
2020-10-27T17:46:36.988Z|00015|dpdk|INFO|EAL: Detected 2 NUMA nodes
2020-10-27T17:46:37.026Z|00016|dpdk|INFO|EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
2020-10-27T17:46:37.042Z|00017|dpdk|INFO|EAL: Selected IOVA mode 'PA'
2020-10-27T17:46:37.051Z|00018|dpdk|WARN|EAL: No free hugepages reported in hugepages-1048576kB
2020-10-27T17:46:37.051Z|00019|dpdk|WARN|EAL: No free hugepages reported in hugepages-1048576kB
2020-10-27T17:46:37.051Z|00020|dpdk|WARN|EAL: No available hugepages reported in hugepages-1048576kB
2020-10-27T17:46:37.051Z|00021|dpdk|INFO|EAL: Probing VFIO support...
2020-10-27T17:46:37.051Z|00022|dpdk|INFO|EAL: VFIO support initialized
2020-10-27T17:46:37.930Z|00023|dpdk|INFO|EAL: PCI device 0000:01:00.0 on NUMA socket 0
2020-10-27T17:46:37.930Z|00024|dpdk|INFO|EAL: probe driver: 8086:1528 net_ixgbe
2020-10-27T17:46:37.930Z|00025|dpdk|INFO|EAL: PCI device 0000:01:00.1 on NUMA socket 0
2020-10-27T17:46:37.930Z|00026|dpdk|INFO|EAL: probe driver: 8086:1528 net_ixgbe
2020-10-27T17:46:37.930Z|00027|dpdk|INFO|EAL: PCI device 0000:07:00.0 on NUMA socket 0
2020-10-27T17:46:37.930Z|00028|dpdk|INFO|EAL: probe driver: 8086:1521 net_e1000_igb
2020-10-27T17:46:37.995Z|00029|dpdk|INFO|EAL: PCI device 0000:07:00.1 on NUMA socket 0
2020-10-27T17:46:37.996Z|00030|dpdk|INFO|EAL: probe driver: 8086:1521 net_e1000_igb
2020-10-27T17:46:38.067Z|00031|dpdk|INFO|DPDK Enabled - initialized
2020-10-27T17:46:38.071Z|00032|pmd_perf|INFO|DPDK provided TSC frequency: 2600000 KHz
2020-10-27T17:46:38.083Z|00033|ofproto_dpif|INFO|netdev#ovs-netdev: Datapath supports recirculation
2020-10-27T17:46:38.083Z|00034|ofproto_dpif|INFO|netdev#ovs-netdev: VLAN header stack length probed as 1
2020-10-27T17:46:38.083Z|00035|ofproto_dpif|INFO|netdev#ovs-netdev: MPLS label stack length probed as 3
2020-10-27T17:46:38.083Z|00036|ofproto_dpif|INFO|netdev#ovs-netdev: Datapath supports truncate action
2020-10-27T17:46:38.083Z|00037|ofproto_dpif|INFO|netdev#ovs-netdev: Datapath supports unique flow ids
2020-10-27T17:46:38.083Z|00038|ofproto_dpif|INFO|netdev#ovs-netdev: Datapath supports clone action
2020-10-27T17:46:38.083Z|00039|ofproto_dpif|INFO|netdev#ovs-netdev: Max sample nesting level probed as 10
2020-10-27T17:46:38.083Z|00040|ofproto_dpif|INFO|netdev#ovs-netdev: Datapath supports eventmask in conntrack action
2020-10-27T17:46:38.083Z|00041|ofproto_dpif|INFO|netdev#ovs-netdev: Datapath supports ct_clear action
2020-10-27T17:46:38.083Z|00042|ofproto_dpif|INFO|netdev#ovs-netdev: Max dp_hash algorithm probed to be 1
2020-10-27T17:46:38.083Z|00043|ofproto_dpif|INFO|netdev#ovs-netdev: Datapath supports check_pkt_len action
2020-10-27T17:46:38.083Z|00044|ofproto_dpif|INFO|netdev#ovs-netdev: Datapath supports timeout policy in conntrack action
2020-10-27T17:46:38.083Z|00045|ofproto_dpif|INFO|netdev#ovs-netdev: Datapath supports ct_state
2020-10-27T17:46:38.083Z|00046|ofproto_dpif|INFO|netdev#ovs-netdev: Datapath supports ct_zone
2020-10-27T17:46:38.083Z|00047|ofproto_dpif|INFO|netdev#ovs-netdev: Datapath supports ct_mark
2020-10-27T17:46:38.083Z|00048|ofproto_dpif|INFO|netdev#ovs-netdev: Datapath supports ct_label
2020-10-27T17:46:38.083Z|00049|ofproto_dpif|INFO|netdev#ovs-netdev: Datapath supports ct_state_nat
2020-10-27T17:46:38.084Z|00050|ofproto_dpif|INFO|netdev#ovs-netdev: Datapath supports ct_orig_tuple
2020-10-27T17:46:38.084Z|00051|ofproto_dpif|INFO|netdev#ovs-netdev: Datapath supports ct_orig_tuple6
2020-10-27T17:46:38.084Z|00052|ofproto_dpif|INFO|netdev#ovs-netdev: Datapath supports IPv6 ND Extensions
2020-10-27T17:46:38.090Z|00053|bridge|INFO|bridge br0: added interface br0 on port 65534
2020-10-27T17:46:38.090Z|00054|netdev_dpdk|WARN|Failed to enable flow control on device 0
2020-10-27T17:46:38.099Z|00055|dpif_netdev|INFO|PMD thread on numa_id: 1, core id: 5 created.
2020-10-27T17:46:38.107Z|00056|dpif_netdev|INFO|PMD thread on numa_id: 0, core id: 2 created.
2020-10-27T17:46:38.107Z|00057|dpif_netdev|INFO|There are 1 pmd threads on numa node 1
2020-10-27T17:46:38.107Z|00058|dpif_netdev|INFO|There are 1 pmd threads on numa node 0
2020-10-27T17:46:38.107Z|00059|dpdk|INFO|Device with port_id=0 already stopped
2020-10-27T17:46:38.382Z|00060|netdev_dpdk|INFO|Port 0: ec:f4:bb:e2:f4:94
2020-10-27T17:46:38.382Z|00061|dpif_netdev|INFO|Core 2 on numa node 0 assigned port 'dpdk-p0' rx queue 0 (measured processing cycles 0).
2020-10-27T17:46:38.383Z|00062|bridge|INFO|bridge br0: added interface dpdk-p0 on port 1
2020-10-27T17:46:38.385Z|00063|dpdk|INFO|VHOST_CONFIG: Linear buffers requested without external buffers, disabling host segmentation offloading support
2020-10-27T17:46:38.390Z|00064|dpdk|INFO|VHOST_CONFIG: vhost-user client: socket created, fd: 1091
2020-10-27T17:46:38.390Z|00065|netdev_dpdk|INFO|vHost User device 'vhost-vm-2004-tpl' created in 'client' mode, using client socket '/var/run/openvswitch-vhost/vhost-vm-2004-tpl'
2020-10-27T17:46:38.394Z|00066|dpdk|WARN|VHOST_CONFIG: failed to connect to /var/run/openvswitch-vhost/vhost-vm-2004-tpl: No such file or directory
2020-10-27T17:46:38.394Z|00067|dpdk|INFO|VHOST_CONFIG: /var/run/openvswitch-vhost/vhost-vm-2004-tpl: reconnecting...
2020-10-27T17:46:38.538Z|00068|dpif_netdev|INFO|Core 2 on numa node 0 assigned port 'dpdk-p0' rx queue 0 (measured processing cycles 0).
2020-10-27T17:46:38.538Z|00069|dpif_netdev|INFO|Core 5 on numa node 1 assigned port 'vhost-vm-2004-tpl' rx queue 0 (measured processing cycles 0).
2020-10-27T17:46:38.538Z|00070|bridge|INFO|bridge br0: added interface vhost-vm-2004-tpl on port 2
2020-10-27T17:46:38.538Z|00071|bridge|INFO|bridge br0: using datapath ID 0000ecf4bbe2f494
2020-10-27T17:46:38.539Z|00072|connmgr|INFO|br0: added service controller "punix:/usr/local/var/run/openvswitch/br0.mgmt"
2020-10-27T17:46:38.539Z|00073|timeval|WARN|Unreasonably long 1554ms poll interval (361ms user, 789ms system)
2020-10-27T17:46:38.539Z|00074|timeval|WARN|faults: 36263 minor, 0 major
2020-10-27T17:46:38.539Z|00075|timeval|WARN|disk: 0 reads, 24 writes
2020-10-27T17:46:38.539Z|00076|timeval|WARN|context switches: 857 voluntary, 1425 involuntary
2020-10-27T17:46:38.539Z|00077|coverage|INFO|Event coverage, avg rate over last: 5 seconds, last minute, last hour, hash=072f9aca:
2020-10-27T17:46:38.539Z|00078|coverage|INFO|bridge_reconfigure 0.0/sec 0.000/sec 0.0000/sec total: 1
2020-10-27T17:46:38.540Z|00079|coverage|INFO|ofproto_flush 0.0/sec 0.000/sec 0.0000/sec total: 1
2020-10-27T17:46:38.540Z|00080|coverage|INFO|ofproto_update_port 0.0/sec 0.000/sec 0.0000/sec total: 3
2020-10-27T17:46:38.540Z|00081|coverage|INFO|rev_flow_table 0.0/sec 0.000/sec 0.0000/sec total: 1
2020-10-27T17:46:38.540Z|00082|coverage|INFO|cmap_expand 0.0/sec 0.000/sec 0.0000/sec total: 44
2020-10-27T17:46:38.540Z|00083|coverage|INFO|cmap_shrink 0.0/sec 0.000/sec 0.0000/sec total: 25
2020-10-27T17:46:38.540Z|00084|coverage|INFO|datapath_drop_upcall_error 0.0/sec 0.000/sec 0.0000/sec total: 2
2020-10-27T17:46:38.540Z|00085|coverage|INFO|dpif_port_add 0.0/sec 0.000/sec 0.0000/sec total: 3
2020-10-27T17:46:38.540Z|00086|coverage|INFO|dpif_flow_flush 0.0/sec 0.000/sec 0.0000/sec total: 1
2020-10-27T17:46:38.540Z|00087|coverage|INFO|dpif_flow_get 0.0/sec 0.000/sec 0.0000/sec total: 23
2020-10-27T17:46:38.540Z|00088|coverage|INFO|dpif_flow_put 0.0/sec 0.000/sec 0.0000/sec total: 24
2020-10-27T17:46:38.540Z|00089|coverage|INFO|dpif_flow_del 0.0/sec 0.000/sec 0.0000/sec total: 23
2020-10-27T17:46:38.540Z|00090|coverage|INFO|dpif_execute 0.0/sec 0.000/sec 0.0000/sec total: 6
2020-10-27T17:46:38.540Z|00091|coverage|INFO|flow_extract 0.0/sec 0.000/sec 0.0000/sec total: 4
2020-10-27T17:46:38.540Z|00092|coverage|INFO|miniflow_malloc 0.0/sec 0.000/sec 0.0000/sec total: 35
2020-10-27T17:46:38.540Z|00093|coverage|INFO|hmap_pathological 0.0/sec 0.000/sec 0.0000/sec total: 4
2020-10-27T17:46:38.540Z|00094|coverage|INFO|hmap_expand 0.0/sec 0.000/sec 0.0000/sec total: 492
2020-10-27T17:46:38.540Z|00095|coverage|INFO|hmap_shrink 0.0/sec 0.000/sec 0.0000/sec total: 2
2020-10-27T17:46:38.540Z|00096|coverage|INFO|netdev_received 0.0/sec 0.000/sec 0.0000/sec total: 1
2020-10-27T17:46:38.540Z|00097|coverage|INFO|netdev_get_stats 0.0/sec 0.000/sec 0.0000/sec total: 3
2020-10-27T17:46:38.540Z|00098|coverage|INFO|poll_create_node 0.0/sec 0.000/sec 0.0000/sec total: 30
2020-10-27T17:46:38.540Z|00099|coverage|INFO|poll_zero_timeout 0.0/sec 0.000/sec 0.0000/sec total: 1
2020-10-27T17:46:38.540Z|00100|coverage|INFO|seq_change 0.0/sec 0.000/sec 0.0000/sec total: 137
2020-10-27T17:46:38.540Z|00101|coverage|INFO|pstream_open 0.0/sec 0.000/sec 0.0000/sec total: 3
2020-10-27T17:46:38.540Z|00102|coverage|INFO|stream_open 0.0/sec 0.000/sec 0.0000/sec total: 1
2020-10-27T17:46:38.540Z|00103|coverage|INFO|util_xalloc 0.0/sec 0.000/sec 0.0000/sec total: 9631
2020-10-27T17:46:38.540Z|00104|coverage|INFO|netdev_set_policing 0.0/sec 0.000/sec 0.0000/sec total: 1
2020-10-27T17:46:38.540Z|00105|coverage|INFO|netdev_get_ethtool 0.0/sec 0.000/sec 0.0000/sec total: 2
2020-10-27T17:46:38.540Z|00106|coverage|INFO|netlink_received 0.0/sec 0.000/sec 0.0000/sec total: 87
2020-10-27T17:46:38.540Z|00107|coverage|INFO|netlink_recv_jumbo 0.0/sec 0.000/sec 0.0000/sec total: 19
2020-10-27T17:46:38.540Z|00108|coverage|INFO|netlink_sent 0.0/sec 0.000/sec 0.0000/sec total: 85
2020-10-27T17:46:38.540Z|00109|coverage|INFO|111 events never hit
2020-10-27T17:46:38.546Z|00110|netdev_dpdk|WARN|Failed to enable flow control on device 0
2020-10-27T17:46:38.547Z|00111|bridge|INFO|ovs-vswitchd (Open vSwitch) 2.14.90
2020-10-27T17:46:47.093Z|00112|memory|INFO|196052 kB peak resident set size after 10.1 seconds
2020-10-27T17:46:47.093Z|00113|memory|INFO|handlers:1 ports:3 revalidators:1 rules:5 udpif keys:2
2020-10-27T17:46:58.392Z|00001|dpdk|INFO|VHOST_CONFIG: /var/run/openvswitch-vhost/vhost-vm-2004-tpl: connected
2020-10-27T17:46:58.392Z|00002|dpdk|INFO|VHOST_CONFIG: new device, handle is 0
2020-10-27T17:46:58.396Z|00001|dpdk|INFO|VHOST_CONFIG: read message VHOST_USER_GET_FEATURES
2020-10-27T17:46:58.396Z|00002|dpdk|INFO|VHOST_CONFIG: read message VHOST_USER_GET_PROTOCOL_FEATURES
2020-10-27T17:46:58.396Z|00003|dpdk|INFO|VHOST_CONFIG: read message VHOST_USER_SET_PROTOCOL_FEATURES
2020-10-27T17:46:58.396Z|00004|dpdk|INFO|VHOST_CONFIG: negotiated Vhost-user protocol features: 0xcb7
2020-10-27T17:46:58.396Z|00005|dpdk|INFO|VHOST_CONFIG: read message VHOST_USER_GET_QUEUE_NUM
2020-10-27T17:46:58.396Z|00006|dpdk|INFO|VHOST_CONFIG: read message VHOST_USER_SET_SLAVE_REQ_FD
2020-10-27T17:46:58.396Z|00007|dpdk|INFO|VHOST_CONFIG: read message VHOST_USER_SET_OWNER
2020-10-27T17:46:58.396Z|00008|dpdk|INFO|VHOST_CONFIG: read message VHOST_USER_GET_FEATURES
2020-10-27T17:46:58.396Z|00009|dpdk|INFO|VHOST_CONFIG: read message VHOST_USER_SET_VRING_CALL
2020-10-27T17:46:58.396Z|00010|dpdk|INFO|VHOST_CONFIG: vring call idx:0 file:1100
2020-10-27T17:46:58.396Z|00011|dpdk|INFO|VHOST_CONFIG: read message VHOST_USER_SET_VRING_CALL
2020-10-27T17:46:58.396Z|00012|dpdk|INFO|VHOST_CONFIG: vring call idx:1 file:1101
2020-10-27T17:47:01.905Z|00013|dpdk|INFO|VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE
2020-10-27T17:47:01.905Z|00014|dpdk|INFO|VHOST_CONFIG: set queue enable: 1 to qp idx: 0
2020-10-27T17:47:01.905Z|00015|netdev_dpdk|INFO|State of queue 0 ( tx_qid 0 ) of vhost device '/var/run/openvswitch-vhost/vhost-vm-2004-tpl' changed to 'enabled'
2020-10-27T17:47:01.905Z|00016|dpdk|INFO|VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE
2020-10-27T17:47:01.905Z|00017|dpdk|INFO|VHOST_CONFIG: set queue enable: 1 to qp idx: 1
2020-10-27T17:47:01.905Z|00018|netdev_dpdk|INFO|State of queue 1 ( rx_qid 0 ) of vhost device '/var/run/openvswitch-vhost/vhost-vm-2004-tpl' changed to 'enabled'
2020-10-27T17:47:01.905Z|00019|dpdk|INFO|VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE
2020-10-27T17:47:01.905Z|00020|dpdk|INFO|VHOST_CONFIG: set queue enable: 1 to qp idx: 0
2020-10-27T17:47:01.905Z|00021|netdev_dpdk|INFO|State of queue 0 ( tx_qid 0 ) of vhost device '/var/run/openvswitch-vhost/vhost-vm-2004-tpl' changed to 'enabled'
2020-10-27T17:47:01.905Z|00022|dpdk|INFO|VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE
2020-10-27T17:47:01.905Z|00023|dpdk|INFO|VHOST_CONFIG: set queue enable: 1 to qp idx: 1
2020-10-27T17:47:01.905Z|00024|netdev_dpdk|INFO|State of queue 1 ( rx_qid 0 ) of vhost device '/var/run/openvswitch-vhost/vhost-vm-2004-tpl' changed to 'enabled'
2020-10-27T17:47:01.908Z|00025|dpdk|INFO|VHOST_CONFIG: read message VHOST_USER_SET_FEATURES
2020-10-27T17:47:01.908Z|00026|dpdk|INFO|VHOST_CONFIG: negotiated Virtio features: 0x17020a782
2020-10-27T17:47:50.172Z|00001|dpif_netdev(revalidator6)|ERR|internal error parsing flow key skb_priority(0),skb_mark(0),ct_state(0),ct_zone(0),ct_mark(0),ct_label(0),recirc_id(0),dp_hash(0),in_port(2),packet_type(ns=0,id=0),eth(src=54:b2:03:14:d0:39,dst=01:00:5e:00:00:01),eth_type(0x0800),ipv4(src=0.0.0.0,dst=224.0.0.1,proto=2,tos=0xc0,ttl=1,frag=no)
2020-10-27T17:47:50.172Z|00002|dpif(revalidator6)|WARN|netdev#ovs-netdev: failed to put[modify] (Invalid argument) ufid:94f25b77-62c5-4859-aec3-e9a41c72dc3d skb_priority(0/0),skb_mark(0/0),ct_state(0/0),ct_zone(0/0),ct_mark(0/0),ct_label(0/0),recirc_id(0),dp_hash(0/0),in_port(2),packet_type(ns=0,id=0),eth(src=54:b2:03:14:d0:39,dst=01:00:5e:00:00:01),eth_type(0x0800),ipv4(src=0.0.0.0/0.0.0.0,dst=224.0.0.1/0.0.0.0,proto=2/0,tos=0xc0/0,ttl=1/0,frag=no), actions:userspace(pid=0,slow_path(match))
2020-10-27T17:47:52.680Z|00003|dpif_netdev(revalidator6)|ERR|internal error parsing flow key skb_priority(0),skb_mark(0),ct_state(0),ct_zone(0),ct_mark(0),ct_label(0),recirc_id(0),dp_hash(0),in_port(2),packet_type(ns=0,id=0),eth(src=44:2c:05:ce:8d:03,dst=01:00:5e:7f:ff:fa),eth_type(0x0800),ipv4(src=192.168.27.150,dst=239.255.255.250,proto=2,tos=0xc0,ttl=1,frag=no)
2020-10-27T17:47:52.680Z|00004|dpif(revalidator6)|WARN|netdev#ovs-netdev: failed to put[modify] (Invalid argument) ufid:aff312f9-4416-49e4-a314-9f895aa96de1 skb_priority(0/0),skb_mark(0/0),ct_state(0/0),ct_zone(0/0),ct_mark(0/0),ct_label(0/0),recirc_id(0),dp_hash(0/0),in_port(2),packet_type(ns=0,id=0),eth(src=44:2c:05:ce:8d:03,dst=01:00:5e:7f:ff:fa),eth_type(0x0800),ipv4(src=192.168.27.150/0.0.0.0,dst=239.255.255.250/0.0.0.0,proto=2/0,tos=0xc0/0,ttl=1/0,frag=no), actions:userspace(pid=0,slow_path(match))
2020-10-27T17:47:55.009Z|00005|dpif_netdev(revalidator6)|ERR|internal error parsing flow key skb_priority(0),skb_mark(0),ct_state(0),ct_zone(0),ct_mark(0),ct_label(0),recirc_id(0),dp_hash(0),in_port(2),packet_type(ns=0,id=0),eth(src=00:02:c9:50:8a:f0,dst=01:00:5e:00:00:fb),eth_type(0x0800),ipv4(src=192.168.27.232,dst=224.0.0.251,proto=2,tos=0,ttl=1,frag=no)
2020-10-27T17:47:55.009Z|00006|dpif_netdev(revalidator6)|ERR|internal error parsing flow key skb_priority(0),skb_mark(0),ct_state(0),ct_zone(0),ct_mark(0),ct_label(0),recirc_id(0),dp_hash(0),in_port(2),packet_type(ns=0,id=0),eth(src=56:ed:b8:d2:f1:e3,dst=01:00:5e:00:00:6a),eth_type(0x0800),ipv4(src=192.168.27.101,dst=224.0.0.106,proto=2,tos=0xc0,ttl=1,frag=no)
2020-10-27T17:47:55.009Z|00007|dpif(revalidator6)|WARN|netdev#ovs-netdev: failed to put[modify] (Invalid argument) ufid:b108050d-511e-447d-8837-35af4af81c4e skb_priority(0/0),skb_mark(0/0),ct_state(0/0),ct_zone(0/0),ct_mark(0/0),ct_label(0/0),recirc_id(0),dp_hash(0/0),in_port(2),packet_type(ns=0,id=0),eth(src=00:02:c9:50:8a:f0,dst=01:00:5e:00:00:fb),eth_type(0x0800),ipv4(src=192.168.27.232/0.0.0.0,dst=224.0.0.251/0.0.0.0,proto=2/0,tos=0/0,ttl=1/0,frag=no), actions:userspace(pid=0,slow_path(match))
2020-10-27T17:47:55.009Z|00008|dpif(revalidator6)|WARN|netdev#ovs-netdev: failed to put[modify] (Invalid argument) ufid:02feab90-66a5-484c-bbc5-8e97985d1f73 skb_priority(0/0),skb_mark(0/0),ct_state(0/0),ct_zone(0/0),ct_mark(0/0),ct_label(0/0),recirc_id(0),dp_hash(0/0),in_port(2),packet_type(ns=0,id=0),eth(src=56:ed:b8:d2:f1:e3,dst=01:00:5e:00:00:6a),eth_type(0x0800),ipv4(src=192.168.27.101/0.0.0.0,dst=224.0.0.106/0.0.0.0,proto=2/0,tos=0xc0/0,ttl=1/0,frag=no), actions:userspace(pid=0,slow_path(match))
2020-10-27T17:47:56.014Z|00009|dpif_netdev(revalidator6)|ERR|internal error parsing flow key skb_priority(0),skb_mark(0),ct_state(0),ct_zone(0),ct_mark(0),ct_label(0),recirc_id(0),dp_hash(0),in_port(2),packet_type(ns=0,id=0),eth(src=00:02:c9:50:8a:f0,dst=01:00:5e:00:00:fc),eth_type(0x0800),ipv4(src=192.168.27.232,dst=224.0.0.252,proto=2,tos=0,ttl=1,frag=no)
2020-10-27T17:47:56.014Z|00010|dpif(revalidator6)|WARN|netdev#ovs-netdev: failed to put[modify] (Invalid argument) ufid:22a5115c-c730-42b2-a590-87b999192781 skb_priority(0/0),skb_mark(0/0),ct_state(0/0),ct_zone(0/0),ct_mark(0/0),ct_label(0/0),recirc_id(0),dp_hash(0/0),in_port(2),packet_type(ns=0,id=0),eth(src=00:02:c9:50:8a:f0,dst=01:00:5e:00:00:fc),eth_type(0x0800),ipv4(src=192.168.27.232/0.0.0.0,dst=224.0.0.252/0.0.0.0,proto=2/0,tos=0/0,ttl=1/0,frag=no), actions:userspace(pid=0,slow_path(match))

Fiware error: Access-Control-Allow-Origin

I'm making a call to the contextBroker and it gives me this error.
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access. The response had HTTP status code 405.
From postman or from freeboard I do not get any of this.
getContextBroker(){
console.log("Consumimos el servicio getContextBroker");
let headers = new Headers ({'Accept': 'application/json', 'Fiware-Service': 'x', 'Fiware-ServicePath': '/x', 'Access-Control-Allow-Origin': '*'});
let options = new RequestOptions ({headers : headers});
return this._http.get(this.urlcontextBrokers, {headers : headers}).map(res => res.json());
}
}
how can I solve that?
I've tried adding: 'Access-Control-Allow-Origin': '*'
But it still does not work
EDIT:
ps ax | grep contextBroker:
862 pts/4 S+ 0:00 grep contextBroker
3792 ? Ssl 27:35 /usr/bin/contextBroker -port 1026 -logDir /var/log/contextBroker -pidpath /var/run/contextBroker/contextBroker.pid -dbhost localhost -db orion -multiservice -logAppend
version:
{
"orion": {
"version": "1.7.0",
"uptime": "12 d, 18 h, 24 m, 20 s",
"git_hash": "e544780eb64a4a2557c1f51dde070b8d82b86c49",
"compile_time": "Wed Feb 8 13:30:24 CET 2017",
"compiled_by": "fermin",
"compiled_in": "centollo"
}
}
EDIT02
Hello, as I said, I do not want to use the cors, I have eliminated that from the header in such a way:
   getContextBroker () {
     console.log ("We consume the getContextBroker service");
     let headers = new Headers ({'Accept': 'application / json', 'Fiware-Service': 'IoFAlmeria', 'Fiware-ServicePath': '/ ARMpalmerillas'});
     let options = new RequestOptions ({headers: headers});
     return this._http.get (this.urlcontextBrokers, {headers: headers}). map (res => res.json ());
   }
}
and I keep giving the same error:
OPTIONS http: // XXX: 1026 / v2 / entities / 405 (Method Not Allowed)
Failed to load http: // XXX: 1026 / v2 / entities /: Response to preflight request does not pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http: // localhost: 4200' is therefore not allowed access. The response had HTTP status code 405.
it has to be the problem of the fiware API since I have designed one with nodejs and I have no problem changing the URL
Update:
Limpiando repositorios:base epel extras fiware mongodb-org-3.2
: mysql-connectors-community mysql-tools-community
: mysql57-community nodesource updates
Limpiando todo
Cleaning up list of fastest mirrors
[root#UAL-IoF2020 ~]# yum install contextBroker
Complementos cargados:fastestmirror, refresh-packagekit, security
Configurando el proceso de instalación
Determining fastest mirrors
epel/metalink | 25 kB 00:00
* base: ftp.uma.es
* epel: ftp.uma.es
* extras: ftp.uma.es
* updates: ftp.uma.es
base | 3.7 kB 00:00
base/primary_db | 4.7 MB 00:00
epel | 4.7 kB 00:00
epel/primary_db | 6.0 MB 00:00
extras | 3.4 kB 00:00
extras/primary_db | 29 kB 00:00
fiware | 951 B 00:00
fiware/primary | 45 kB 00:00
mongodb-org-3.2 | 2.5 kB 00:00
mongodb-org-3.2/primary_db | 78 kB 00:00
mysql-connectors-community | 2.5 kB 00:00
mysql-connectors-community/primary_db | 18 kB 00:00
mysql-tools-community | 2.5 kB 00:00
mysql-tools-community/primary_db | 38 kB 00:00
mysql57-community | 2.5 kB 00:00
mysql57-community/primary_db | 139 kB 00:00
nodesource | 2.5 kB 00:00
nodesource/primary_db | 51 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 6.4 MB 00:00
El paquete contextBroker-1.7.0-1.x86_64 ya se encuentra instalado con su versión más reciente
Nada para hacer
CORS requests are only supported by Orion Context Broker version 1.10 and above.
As #JoseManuelCantera has pointed out, you do not need to add any CORS specific headers to your request, those are handled by your client (browser, Postman etc.)
You need to:
Upgrade your version to 1.10
Start Orion in CORS mode
You can start Orion in CORS mode for any origin (Orion will accept CORS requests from any origin) as below:
contextBroker -corsOrigin __ALL
Please take a look at the CORS documentation for Orion for more information.
UPDATE
Please allow me to shortly explain CORS pre-flight logic. If your request is not a simple request, your browser will do a pre-flight request prior to yours with the OPTIONS method. If Orion is not started in CORS mode, you will always get method not allowed as a response to your non-simple requests.
So what is the problem, why are you getting different results with different clients? Postman (curl etc.) does exactly what you want it to do and sends the requests as you have configured. It does not check if the request you are sending should be pre-flighted or not.
On the other hand, your browser does check your request and do a pre-flight if necessary. You have no control over this other than modifying your request.
The Javascript framework you are working with is probably adding a header to the request rendering it a "non-simple" request. For example: X-Requested-With. Please see this question.
My suggestion is to take a look at the details of the request your browser sends (headers, methods etc.) and see what makes it a non-simple request. Then do the necessary changes on your js code to make sure your request falls within the scope of simple requests.
Having said that, you will need to upgrade your Orion version eventually since for example, a DELETE request is never going to be treated as a simple request when sent over a browser.
I think you need to upgrade to version 1.10 so that you can use CORS.
You do not need to add any header ;) and actually the Access-Control-Allow-Origing header is sent in the server response not by the client request

WebSphere Liberty Profile blocking on Datasource lookup

I'm trying to configure a datasource in IBM WebSphere Liberty Profile (16.0.0.3) and this is what I've done so far:
server.xml
<authData id="dbuser" password="{xor}blablabla" user="MY_USER"/>
<dataSource id="Oracle" isolationLevel="TRANSACTION_READ_COMMITTED"
jdbcDriverRef="OracleDriver"
jndiName="EPMS_DS"
recoveryAuthDataRef="dbuser"
type="javax.sql.ConnectionPoolDataSource">
<properties.oracle databaseName="DBNAME" portNumber="1521" serverName="SERVERNAME"/>
</dataSource>
<jdbcDriver id="OracleDriver"
javax.sql.ConnectionPoolDataSource="oracle.jdbc.pool.OracleConnectionPoolDataSource"
libraryRef="shared-library"/>
web.xml
<resource-env-ref>
<description>The Oracle DS</description>
<resource-env-ref-name>jdbc/OracleDS</resource-env-ref-name>
<resource-env-ref-type>javax.sql.DataSource</resource-env-ref-type>
</resource-env-ref>
ibm-web-bnd.xml
<resource-ref name="jdbc/OracleDS" binding-name="EPMS_DS">
<authentication-alias name="dbuser" />
</resource-ref>
However, besides the application server is taking more than 2 minutes to startup, my application seems to freeze on the following instruction:
ctx = new InitialContext();
ctx.lookup("java:comp/env/jdbc/OracleDS");
The log doesn't show any errors, the last line it shows is an application's debug message indicating it is going to do a JNDI lookup.
I've also tried different configurations in server.xml, without <authData> and explicitly defining user and password on the datasource, but with identical results:
<dataSource id="Oracle" isolationLevel="TRANSACTION_READ_COMMITTED" jdbcDriverRef="OracleDriver" jndiName="EPMS_DS" type="javax.sql.ConnectionPoolDataSource">
<properties.oracle URL="jdbc:oracle:thin:#SERVERNAME:1521:DBNAME" password="{xor}blablabla" user="MY_USER"/>
</dataSource>
Sadly, Liberty Profile doesn't seem to provide a way to test the DB connection, but everything seems correctly configured (I can assure the credentials are correct, as well as the server name and port). What am I missing here?
EDIT #1
Following njr's suggestion, I've performed a thread dump and here is a summary:
- waiting on com.ibm.tx.jta.impl.EventSemaphore#737eaefc
- waiting on com.ibm.ws.objectManager.FileLogOutput$FlushHelper#19d51071
- waiting on com.ibm.ws.objectManager.FileLogOutput$NotifyHelper#2fa0da91
- waiting on com.ibm.ws.objectManager.ObjectManagerState$CheckpointHelper#5b0919fc
- waiting on com.ibm.ws.sib.msgstore.persistence.dispatcher.SpillDispatcher$DispatchingLock#1620db94
(8 Occorrences, but different instances)
...
- waiting on com.ibm.ws.threading.internal.BoundedBuffer$GetQueueLock#c8a05b6
(56 Occorrences, but different instances)
...
- waiting on java.lang.Object#4c1d5897
- waiting on java.lang.ref.Reference$Lock#5448da4c
- waiting on java.lang.ref.ReferenceQueue$Lock#f91b025
- waiting on java.util.LinkedList#5b213416
- waiting on java.util.LinkedList#6cb46e1f
- waiting on java.util.TaskQueue#f50561c
(14 Occorrences, but different instances)
...
- waiting on java.util.concurrent.atomic.AtomicReference#5476d077
- waiting on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject#4da17c93
- waiting on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject#513339c6
- waiting on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject#5dc2ae0f
- waiting on org.eclipse.osgi.framework.eventmgr.EventManager$EventThread#236970be
- waiting on org.eclipse.osgi.framework.eventmgr.EventManager$EventThread#6dfdd5
- waiting on org.eclipse.osgi.framework.eventmgr.EventManager$EventThread#72ce4e1c
- blocked on com.ibm.tx.jta.embeddable.impl.EmbeddableTMHelper#5748c911
- blocked on com.ibm.tx.jta.embeddable.impl.EmbeddableTMHelper#5748c911
Can someone help me to interpret this?
EDIT #2
Here's where the complete stack trace of the blocked threads:
LargeThreadPool-thread-148 [217] (BLOCKED)
com.ibm.tx.jta.embeddable.impl.EmbeddableTMHelper.start line: 63
com.ibm.tx.jta.util.TxTMHelper.start line: 461
com.ibm.tx.util.TMHelper.start line: 74
com.ibm.tx.jta.util.TxTMHelper.checkTMState line: 500
com.ibm.tx.util.TMHelper.checkTMState line: 116
com.ibm.tx.jta.impl.TranManagerSet.registerResourceInfo line: 270
com.ibm.ws.transaction.services.TransactionManagerService.registerResourceInfo line: 260
com.ibm.ejs.j2c.ConnectionManager.registerXAResourceInfo line: 2537
com.ibm.ejs.j2c.ConnectionManager.<init> line: 509
com.ibm.ejs.j2c.ConnectionManagerServiceImpl.getConnectionManager line: 407
com.ibm.ejs.j2c.ConnectionManagerServiceImpl.getConnectionManager line: 54
com.ibm.ws.jca.cm.AbstractConnectionFactoryService.createResource line: 146
com.ibm.ws.injectionengine.osgi.internal.IndirectJndiLookupObjectFactory.createResourceWithFilter line: 346
com.ibm.ws.injectionengine.osgi.internal.IndirectJndiLookupObjectFactory.createResource line: 319
com.ibm.ws.injectionengine.osgi.internal.IndirectJndiLookupObjectFactory.getObjectInstance line: 133
com.ibm.ws.injectionengine.osgi.internal.IndirectJndiLookupObjectFactory.getObjectInstance line: 99
com.ibm.wsspi.injectionengine.InjectionBinding.getInjectionObjectInstance line: 1556
com.ibm.wsspi.injectionengine.InjectionBinding.getInjectionObject line: 1433
com.ibm.wsspi.injectionengine.InjectionBinding.getInjectionObject line: 1389
com.ibm.ws.injectionengine.osgi.internal.naming.InjectionJavaColonHelper.getObjectInstance line: 116
com.ibm.ws.jndi.url.contexts.javacolon.internal.JavaURLContext.lookup line: 333
com.ibm.ws.jndi.url.contexts.javacolon.internal.JavaURLContext.lookup line: 371
org.apache.aries.jndi.DelegateContext.lookup line: 161
javax.naming.InitialContext.lookup line: 417
pt.sibs.epms.persistence.utils.EntityManagerFactoryController.jndiLookupUsed line: 264
pt.sibs.epms.persistence.utils.EntityManagerFactoryController.checkConfiguration line: 115
pt.sibs.epms.persistence.utils.EntityManagerFactoryController.<init> line: 95
pt.sibs.epms.persistence.utils.EntityManagerFactoryController.<init> line: 51
pt.sibs.epms.persistence.utils.EntityManagerFactoryController$SingletonHolder.<clinit> line: 81
pt.sibs.epms.persistence.utils.EntityManagerFactoryController.getInstance line: 88
pt.sibs.epms.util.logging.LoggerConfiguration.<clinit> line: 33
pt.sibs.epms.ecc.renderer.HtmlFormRenderer.<clinit> line: 25
java.lang.Class.forName0 line: not available [native method]
java.lang.Class.forName line: 348
com.ibm.ws.webcontainer.osgi.webapp.WebApp.addClassToHandlesTypesStartupSet line: 1104
com.ibm.ws.webcontainer.osgi.webapp.WebApp.scanForHandlesTypesClasses line: 1038
com.ibm.ws.webcontainer.webapp.WebApp.initializeServletContainerInitializers line: 2493
com.ibm.ws.webcontainer.webapp.WebApp.initialize line: 1037
com.ibm.ws.webcontainer.webapp.WebApp.initialize line: 6545
com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApp line: 466
com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.createRunnableHandler line: 264
com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.createRunnableHandler line: 329
com.ibm.ws.http.internal.VirtualHostImpl.discriminate line: 251
com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready line: 301
com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination line: 471
com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest line: 405
com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest line: 285
com.ibm.ws.http.channel.internal.inbound.HttpICLReadCallback.complete line: 66
com.ibm.ws.channel.ssl.internal.SSLReadServiceContext$SSLReadCompletedCallback.complete line: 1777
com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete line: 504
com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO line: 574
com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun line: 929
com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run line: 1018
java.util.concurrent.ThreadPoolExecutor.runWorker line: 1142
java.util.concurrent.ThreadPoolExecutor$Worker.run line: 617
java.lang.Thread.run line: 745
And the second thread:
LargeThreadPool-thread-3 [33] (BLOCKED)
com.ibm.tx.jta.embeddable.impl.EmbeddableTMHelper.start line: 63
com.ibm.tx.jta.util.TxTMHelper.start line: 461
com.ibm.tx.util.TMHelper.start line: 74
com.ibm.tx.jta.util.TxTMHelper.checkTMState line: 500
com.ibm.tx.util.TMHelper.checkTMState line: 116
com.ibm.tx.jta.impl.TranManagerSet.begin line: 167
com.ibm.ejs.csi.TranStrategy.beginGlobalTx line: 593
com.ibm.ejs.csi.Required.preInvoke line: 56
com.ibm.ejs.csi.TransactionControlImpl.preInvoke line: 222
com.ibm.ejs.container.EJSContainer.preInvokeActivate line: 3176
com.ibm.ejs.container.EJSContainer.EjbPreInvoke line: 2576
com.ibm.ejs.container.TimedObjectWrapper.invokeCallback line: 84
com.ibm.ejs.container.TimerNpRunnable.doWork line: 196
com.ibm.ejs.container.TimerNpRunnable.run line: 103
java.util.concurrent.Executors$RunnableAdapter.call line: 511
java.util.concurrent.FutureTask.run line: 266
java.util.concurrent.ThreadPoolExecutor.runWorker line: 1142
java.util.concurrent.ThreadPoolExecutor$Worker.run line: 617
java.lang.Thread.run line: 745
Edit #3
The thread that is WAITING and, apparently, blocking the other two threads:
LargeThreadPool-thread-38 [103] (WAITING)
java.lang.Object.wait line: not available [native method]
java.lang.Object.wait line: 502
com.ibm.tx.jta.impl.EventSemaphore.waitEvent line: 71
com.ibm.tx.jta.impl.RecoveryManager.waitForReplayCompletion line: 1273
com.ibm.tx.jta.impl.TxRecoveryAgentImpl.initiateRecovery line: 413
com.ibm.ws.recoverylog.spi.RecoveryDirectorImpl.directInitialization line: 751
com.ibm.ws.recoverylog.spi.RecoveryDirectorImpl.driveLocalRecovery line: 1240
com.ibm.ws.recoverylog.spi.RecLogServiceImpl.start line: 125
com.ibm.tx.jta.embeddable.impl.EmbeddableTMHelper.start line: 130
com.ibm.tx.jta.util.TxTMHelper.start line: 461
com.ibm.tx.util.TMHelper.start line: 74
com.ibm.tx.jta.util.TxTMHelper.checkTMState line: 500
com.ibm.tx.util.TMHelper.checkTMState line: 116
com.ibm.tx.jta.impl.TranManagerSet.begin line: 167
com.ibm.ws.transaction.services.TransactionManagerService.begin line: 281
com.ibm.ws.concurrent.persistent.internal.PersistentExecutorImpl$PollingTask.run line: 2239
Not sure if it is related, but ffdc is showing the following exception:
------Start of DE processing------ = [09-11-2016 14:41:09:006 GMT]
Exception = com.ibm.ws.recoverylog.spi.LogIncompatibleException
Source = com.ibm.ws.recoverylog.spi.LogHandle
probeid = 326
Stack Dump = com.ibm.ws.recoverylog.spi.LogIncompatibleException
at com.ibm.ws.recoverylog.spi.LogFileHandle.fileOpen(LogFileHandle.java:522)
at com.ibm.ws.recoverylog.spi.LogHandle.openLog(LogHandle.java:324)
at com.ibm.ws.recoverylog.spi.MultiScopeRecoveryLog.openLog(MultiScopeRecoveryLog.java:602)at com.ibm.ws.recoverylog.spi.RecoveryLogImpl.openLog(RecoveryLogImpl.java:77)
at com.ibm.tx.jta.impl.RecoveryManager.run(RecoveryManager.java:1835)
at java.lang.Thread.run(Thread.java:745)
In your Edit #3, the thread that is waiting in
com.ibm.tx.jta.impl.RecoveryManager.waitForReplayCompletion
will have spawned another recoveryManager thread who's role is to access the transaction log files in your flesystem. That other thread Should do the minimal amount of file processing necessary before signalling to the waiting thread that it may continue. Can you see another thread with a stack containing
com.ibm.tx.jta.impl.RecoveryManager.run ?
I am concerned about the LogIncompatibleException. It suggests that the transaction log files on your filesystem are
corrupt. This should not cause the server to hang and I believe you've hit a product defect.
If you need to make progress quickly, it may be appropriate in your scenario to delete the transaction log files.
Please note that this is something we only suggest to customers with extreme care as the transaction logs ensure
the integrity of distributed transactions. In a production environment we'd generally recommend that such action
is only taken under the guidance of IBM Level 3 Service. But in a test/evaluation scenario it can be applicable.
The Liberty transaction log info is stored in the /wlp/usr/servers//tranlog
directory. If appropriate the tranlog and partnerlog subdirectories may be deleted and the server restarted.

Unable to use JMockit with OpenJDK 1.7

While trying to use JMockit (1.21) with JUnit (4.8) test cases I ran into issue with OpenJDK (1.7). I'm using Eclipse. After searching on SO, I found the solution about adding '-javaagent:path/to/JMockit/jar' argument to JVM and putting JMockit dependency before JUnit in maven. But after adding that argument, my test won't run and instead I get following error. Did anyone have this issue and how did you solve it? It works if I use OracleJDK but I'm looking for solution where it runs with OpenJDK.
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000051cfbbe8, pid=9268, tid=2272
#
# JRE version: OpenJDK Runtime Environment (7.0) (build 1.7.0-45-asmurthy_2014_01_10_19_46-b00)
# Java VM: Dynamic Code Evolution 64-Bit Server VM (24.45-b06 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# V [jvm.dll+0x6bbe8]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
#
--------------- T H R E A D ---------------
Current thread (0x000000000270c000): VMThread [stack: 0x00000000074e0000,0x00000000075e0000] [id=2272]
siginfo: ExceptionCode=0xc0000005, reading address 0x0000000000000000
Registers:
RAX=0x0000000000000000, RBX=0x0000000000000000, RCX=0x0000000000000000, RDX=0x00000007fae04720
RSP=0x00000000075df190, RBP=0x00000000523a16d8, RSI=0x0000000002abe2b0, RDI=0x00000000523a16e0
R8 =0x0000000000000000, R9 =0x0000000000000100, R10=0x0000000000041999, R11=0x0000000008eab1f0
R12=0x000000000270c000, R13=0x00000007fb208040, R14=0x0000000000000001, R15=0x00000000000003d8
RIP=0x0000000051cfbbe8, EFLAGS=0x0000000000010206
Top of Stack: (sp=0x00000000075df190)
0x00000000075df190: 00000007fb208050 0000000002abe200
0x00000000075df1a0: 00000007fb208040 000000000270c000
0x00000000075df1b0: 00000000523a16e0 0000000051e0ecbc
0x00000000075df1c0: 0000000000000000 00000000523a16d8
0x00000000075df1d0: 0000000002abe2b0 000000000270c000
0x00000000075df1e0: 00000000521ea7b8 0000000052450100
0x00000000075df1f0: 0000000000000000 00000000521ea7a0
0x00000000075df200: 0000000000001000 00000000075df1e0
0x00000000075df210: 0000000000000100 0000000000000000
0x00000000075df220: 00000000073158d8 00000000000003d8
0x00000000075df230: 00000000073158d8 0000000002701ac0
0x00000000075df240: 00000000073154f0 0000000051e74dc7
0x00000000075df250: 00000000026c3de0 0000000000000001
0x00000000075df260: 0000000002abe2b0 0000000007315500
0x00000000075df270: 0000000007315500 00000000073154f0
0x00000000075df280: 0000000002701ac0 0000000051e74072
Instructions: (pc=0x0000000051cfbbe8)
0x0000000051cfbbc8: cc cc cc cc cc cc cc cc 48 89 5c 24 08 57 48 83
0x0000000051cfbbd8: ec 20 48 8b 05 17 20 69 00 48 8b 0d c0 e5 68 00
0x0000000051cfbbe8: 48 63 18 e8 60 c3 fa ff 33 ff 48 85 db 7e 37 66
0x0000000051cfbbf8: 0f 1f 84 00 00 00 00 00 48 8b 05 f1 1f 69 00 48
Register to memory mapping:
RAX=0x0000000000000000 is an unknown value
RBX=0x0000000000000000 is an unknown value
RCX=0x0000000000000000 is an unknown value
RDX=0x00000007fae04720 is an oop
{instance class}
- klass: {other class}
RSP=0x00000000075df190 is an unknown value
RBP=0x00000000523a16d8 is an unknown value
RSI=0x0000000002abe2b0 is pointing into the stack for thread: 0x00000000026c7000
RDI=0x00000000523a16e0 is an unknown value
R8 =0x0000000000000000 is an unknown value
R9 =0x0000000000000100 is an unknown value
R10=0x0000000000041999 is an unknown value
R11=0x0000000008eab1f0 is an unknown value
R12=0x000000000270c000 is an unknown value
R13=0x00000007fb208040 is an oop
{instance class}
- klass: {other class}
R14=0x0000000000000001 is an unknown value
R15=0x00000000000003d8 is an unknown value
Stack: [0x00000000074e0000,0x00000000075e0000], sp=0x00000000075df190, free space=1020k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [jvm.dll+0x6bbe8]
VM_Operation (0x0000000002abe2b0): RedefineClasses, mode: safepoint, requested by thread 0x00000000026c7000
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x000000000739c800 JavaThread "Attach Listener" daemon [_thread_blocked, id=6668, stack(0x0000000007c60000,0x0000000007d60000)]
0x000000000739b000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=5620, stack(0x0000000007aa0000,0x0000000007ba0000)]
0x0000000007379800 JavaThread "Finalizer" daemon [_thread_blocked, id=9832, stack(0x00000000078c0000,0x00000000079c0000)]
0x0000000007370000 JavaThread "Reference Handler" daemon [_thread_blocked, id=7516, stack(0x0000000007680000,0x0000000007780000)]
0x00000000026c7000 JavaThread "main" [_thread_blocked, id=6580, stack(0x00000000029c0000,0x0000000002ac0000)]
Other Threads:
=>0x000000000270c000 VMThread [stack: 0x00000000074e0000,0x00000000075e0000] [id=2272]
VM state:at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event])
[0x00000000026c3e60] Threads_lock - owner thread: 0x000000000270c000
[0x00000000026c4360] Heap_lock - owner thread: 0x00000000026c7000
[0x00000000026c4b60] RedefineClasses_lock - owner thread: 0x00000000026c7000
Heap
def new generation total 118016K, used 21035K [0x000000067ae00000, 0x0000000682e00000, 0x00000006fae00000)
eden space 104960K, 20% used [0x000000067ae00000, 0x000000067c28af18, 0x0000000681480000)
from space 13056K, 0% used [0x0000000681480000, 0x0000000681480000, 0x0000000682140000)
to space 13056K, 0% used [0x0000000682140000, 0x0000000682140000, 0x0000000682e00000)
tenured generation total 262144K, used 0K [0x00000006fae00000, 0x000000070ae00000, 0x00000007fae00000)
the space 262144K, 0% used [0x00000006fae00000, 0x00000006fae00000, 0x00000006fae00200, 0x000000070ae00000)
compacting perm gen total 21248K, used 4129K [0x00000007fae00000, 0x00000007fc2c0000, 0x0000000800000000)
the space 21248K, 19% used [0x00000007fae00000, 0x00000007fb208478, 0x00000007fb208600, 0x00000007fc2c0000)
No shared spaces configured.
Card table byte_map: [0x0000000005e60000,0x0000000006a90000] byte_map_base: 0x0000000002a89000
Polling page: 0x0000000000150000
Code Cache [0x0000000002da0000, 0x0000000003010000, 0x0000000005da0000)
total_blobs=187 nmethods=0 adapters=156 free_code_cache=48761Kb largest_free_block=49932032
Compilation events (0 events):
No events
GC Heap History (0 events):
No events
Deoptimization events (0 events):
No events
Internal exceptions (10 events):
Event: 1.210 Thread 0x00000000026c7000 Threw 0x000000067c036fa0 at C:\openjdk\jdk7u\hotspot\src\share\vm\interpreter\interpreterRuntime.cpp:347
Event: 1.211 Thread 0x00000000026c7000 Threw 0x000000067c03ae78 at C:\openjdk\jdk7u\hotspot\src\share\vm\prims\jvm.cpp:1244
Event: 1.212 Thread 0x00000000026c7000 Threw 0x000000067c045f10 at C:\openjdk\jdk7u\hotspot\src\share\vm\prims\jvm.cpp:1244
Event: 1.213 Thread 0x00000000026c7000 Threw 0x000000067c057398 at C:\openjdk\jdk7u\hotspot\src\share\vm\prims\jvm.cpp:1244
Event: 1.214 Thread 0x00000000026c7000 Threw 0x000000067c066510 at C:\openjdk\jdk7u\hotspot\src\share\vm\prims\jvm.cpp:1244
Event: 1.215 Thread 0x00000000026c7000 Threw 0x000000067c072ac0 at C:\openjdk\jdk7u\hotspot\src\share\vm\prims\jvm.cpp:1244
Event: 1.216 Thread 0x00000000026c7000 Threw 0x000000067c084678 at C:\openjdk\jdk7u\hotspot\src\share\vm\prims\jvm.cpp:1244
Event: 1.217 Thread 0x00000000026c7000 Threw 0x000000067c08c7b0 at C:\openjdk\jdk7u\hotspot\src\share\vm\prims\jvm.cpp:1244
Event: 1.218 Thread 0x00000000026c7000 Threw 0x000000067c0934a8 at C:\openjdk\jdk7u\hotspot\src\share\vm\prims\jvm.cpp:1244
Event: 1.218 Thread 0x00000000026c7000 Threw 0x000000067c09cac8 at C:\openjdk\jdk7u\hotspot\src\share\vm\prims\jvm.cpp:1244
Events (10 events):
Event: 1.215 loading class 0x0000000008956520 done
Event: 1.216 loading class 0x0000000008959de0
Event: 1.216 loading class 0x0000000008959de0 done
Event: 1.217 loading class 0x0000000008ea91d0
Event: 1.217 loading class 0x0000000008ea91d0 done
Event: 1.218 loading class 0x0000000008d643e0
Event: 1.218 loading class 0x0000000008d643e0 done
Event: 1.218 loading class 0x0000000008958d20
Event: 1.218 loading class 0x0000000008958d20 done
Event: 1.219 Executing VM operation: RedefineClasses
Dynamic libraries:
0x000000013f7c0000 - 0x000000013f7f1000 S:\OpenJDK\bin\javaw.exe
0x0000000076ef0000 - 0x0000000077099000 C:\WINDOWS\SYSTEM32\ntdll.dll
0x0000000076cb0000 - 0x0000000076dcf000 C:\WINDOWS\system32\kernel32.dll
0x000007fefcde0000 - 0x000007fefce4b000 C:\WINDOWS\system32\KERNELBASE.dll
0x0000000074990000 - 0x0000000074a19000 C:\WINDOWS\System32\SYSFER.DLL
0x000007feff0f0000 - 0x000007feff1cb000 C:\WINDOWS\system32\ADVAPI32.dll
0x000007fefed40000 - 0x000007fefeddf000 C:\WINDOWS\system32\msvcrt.dll
0x000007fefe660000 - 0x000007fefe67f000 C:\WINDOWS\SYSTEM32\sechost.dll
0x000007fefefc0000 - 0x000007feff0ed000 C:\WINDOWS\system32\RPCRT4.dll
0x0000000076df0000 - 0x0000000076eea000 C:\WINDOWS\system32\USER32.dll
0x000007fefe270000 - 0x000007fefe2d7000 C:\WINDOWS\system32\GDI32.dll
0x000007fefe360000 - 0x000007fefe36e000 C:\WINDOWS\system32\LPK.dll
0x000007fefe370000 - 0x000007fefe43a000 C:\WINDOWS\system32\USP10.dll
0x000007fefb460000 - 0x000007fefb654000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.18837_none_fa3b1e3d17594757\COMCTL32.dll
0x000007fefee30000 - 0x000007fefeea1000 C:\WINDOWS\system32\SHLWAPI.dll
0x000007fefe630000 - 0x000007fefe65e000 C:\WINDOWS\system32\IMM32.DLL
0x000007fefeeb0000 - 0x000007fefefb9000 C:\WINDOWS\system32\MSCTF.dll
0x0000000052420000 - 0x00000000524f2000 S:\OpenJDK\jre\bin\msvcr100.dll
0x0000000051c90000 - 0x000000005241e000 S:\OpenJDK\jre\bin\server\jvm.dll
0x000007fef82b0000 - 0x000007fef82b9000 C:\WINDOWS\system32\WSOCK32.dll
0x000007fefede0000 - 0x000007fefee2d000 C:\WINDOWS\system32\WS2_32.dll
0x000007feff1d0000 - 0x000007feff1d8000 C:\WINDOWS\system32\NSI.dll
0x000007fefaca0000 - 0x000007fefacdb000 C:\WINDOWS\system32\WINMM.dll
0x00000000770c0000 - 0x00000000770c7000 C:\WINDOWS\system32\PSAPI.DLL
0x000007feece20000 - 0x000007feece2f000 S:\OpenJDK\jre\bin\verify.dll
0x000007fee0320000 - 0x000007fee0348000 S:\OpenJDK\jre\bin\java.dll
0x000007fee6ee0000 - 0x000007fee6f03000 S:\OpenJDK\jre\bin\instrument.dll
0x000007fee06e0000 - 0x000007fee06f5000 S:\OpenJDK\jre\bin\zip.dll
0x000007fef1f90000 - 0x000007fef20b5000 C:\WINDOWS\system32\dbghelp.dll
VM Arguments:
jvm_args: -javaagent:S:\.m2\org\jmockit\jmockit\1.21\jmockit-1.21.jar -Dfile.encoding=ISO-8859-1
java_command: org.eclipse.jdt.internal.junit.runner.RemoteTestRunner -version 3 -port 61294 -testLoaderClass org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader -loaderpluginname org.eclipse.jdt.junit4.runtime -classNames com.examples.JMockitTest
java_command: org.eclipse.jdt.internal.junit.runner.RemoteTestRunner -version 3 -port 61294 -testLoaderClass org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader -loaderpluginname org.eclipse.jdt.junit4.runtime -classNames com.examples.JMockitTest
Launcher Type: SUN_STANDARD
Environment Variables:
JRE_HOME=C:\Program Files (x86)\IBM\RationalSDLC\Common\Java5.0\jre
PATH=C:\Python27\;C:\Python27\Scripts;C:\Program Files (x86)\IBM\RationalSDLC\Clearquest\cqcli\bin;C:\PERL51001\Perl\site\bin;C:\PERL51001\Perl\bin;C:\Program Files (x86)\RSA SecurID Token Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files (x86)\Microsoft Application Virtualization Client;C:\Program Files (x86)\java\jre6\bin\;C:\Perl64\bin;C:\Program Files (x86)\Perforce;C:\Program Files (x86)\IBM\RationalSDLC\ClearCase\bin;C:\Program Files (x86)\IBM\RationalSDLC\common;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseGit\bin;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\nodejs\
Thanks

PHP 7 Performance

I've tried to reproduce this benchmark which compares PHP 7 with older versions on a Wordpress server: http://talks.php.net/oz15#/wpbench
My configuration is nearly the same, the server has an i7, SSD, 16GB RAM and debian. The server software is nginx. Suprisingly my results differ a lot from the ones linked above.
In my tests Siege (https://www.joedog.org/siege-home/) outputs the following:
For PHP 7.0.0RC1:
siege -c100 -r100 http://10.22.255.133/wordpress/
** SIEGE 3.0.8
** Preparing 100 concurrent users for battle.
The server is now under siege.. done.
Transactions: 10000 hits
Availability: 100.00 %
Elapsed time: 131.61 secs
Data transferred: 95.77 MB
Response time: 0.75 secs
Transaction rate: 75.98 trans/sec
Throughput: 0.73 MB/sec
Concurrency: 56.98
Successful transactions: 10000
Failed transactions: 0
Longest transaction: 1.01
Shortest transaction: 0.04
For PHP 5.6.12:
siege -c100 -r100 http://10.22.255.133/wordpress/
** SIEGE 3.0.8
** Preparing 100 concurrent users for battle.
The server is now under siege.. done.
Transactions: 10000 hits
Availability: 100.00 %
Elapsed time: 63.41 secs
Data transferred: 95.77 MB
Response time: 0.03 secs
Transaction rate: 157.70 trans/sec
Throughput: 1.51 MB/sec
Concurrency: 4.45
Successful transactions: 10000
Failed transactions: 0
Longest transaction: 0.63
Shortest transaction: 0.01
When looking at the transaction rate you can see, that PHP 5 is about two times faster than PHP 7. I can't believe that.
Another interesting fact is, that running this benchmark (http://www.php-benchmark-script.com/) results in PHP 7 being about 3 times faster than PHP 5 (of course on the same server where I've also tested Wordpress). The measured results were:
PHP 7.0.0RC1 | PHP 5.5.28
Math: 0.201 | 0.683
String Manipulation: 0.271 | 0.77
Loops: 0.166 | 0.486
If Else: 0.12 | 0.295
I've uploaded both phpinfo() files in case that helps:
PHP Version 7.0.0RC1: http://simsso.de/downloads/stackoverflow/php7.html
PHP Version 5.6.12-0+deb8u1: http://simsso.de/downloads/stackoverflow/php5.html
Do you have any idea why PHP 7 is that much slower in my tests with Wordpress?
With opcache enabled PHP 7 is actually twice as fast as PHP 5. Thanks Mjh for your hint!
I've made the following measurements on a randomly filled WordPress Server.
Siege now outputs the following for PHP 7.0.0RC1:
Transactions: 10000 hits
Availability: 100.00 %
Elapsed time: 62.14 secs
Data transferred: 604.20 MB
Response time: 0.02 secs
Transaction rate: 160.93 trans/sec
Throughput: 9.72 MB/sec
Concurrency: 3.77
Successful transactions: 10000
Failed transactions: 0
Longest transaction: 0.41
Shortest transaction: 0.01
And PHP 5.6.12:
siege -c100 -r100 http://10.22.255.133/wordpress/
** SIEGE 3.0.8
** Preparing 100 concurrent users for battle.
The server is now under siege.. done.
Transactions: 10000 hits
Availability: 100.00 %
Elapsed time: 119.98 secs
Data transferred: 604.20 MB
Response time: 0.60 secs
Transaction rate: 83.35 trans/sec
Throughput: 5.04 MB/sec
Concurrency: 49.86
Successful transactions: 10000
Failed transactions: 0
Longest transaction: 4.06
Shortest transaction: 0.04
According to the output of phpinfo you posted, opcache isn't enabled for your PHP 7, while it is for PHP 5. That alone can amount for a huge difference.
I currently have the same surprising results on the CLI side.
One of my old projects uses a PHING build. It was running on PHP 5.3 then PHP 5.6.
I tried using PHP 7 and noticed a huge difference. So i decided to time the script execution.
FYI it is a real life projects with thousands of files processed during the build.
Build using PHP 5.3.29:
3 minutes and 44 seconds elapsed.
Build using PHP 7.2.11:
11 minutes and 41 seconds elapsed.
I noticed the CLI did not have opcache activated, here is the results with opcache:
Build using PHP 7.2.11 + opcache:
12 minutes and 18 seconds elapsed.
Yes, WORSE
FYI:
$ php --info |grep opcache
opcache.blacklist_filename => no value => no value
opcache.consistency_checks => 0 => 0
opcache.dups_fix => Off => Off
opcache.enable => On => On
opcache.enable_cli => On => On
opcache.enable_file_override => Off => Off
opcache.error_log => no value => no value
opcache.file_cache => no value => no value
opcache.file_cache_consistency_checks => 1 => 1
opcache.file_cache_only => 0 => 0
opcache.file_update_protection => 2 => 2
opcache.force_restart_timeout => 180 => 180
opcache.huge_code_pages => Off => Off
opcache.inherited_hack => On => On
opcache.interned_strings_buffer => 8 => 8
opcache.lockfile_path => /tmp => /tmp
opcache.log_verbosity_level => 1 => 1
opcache.max_accelerated_files => 10000 => 10000
opcache.max_file_size => 0 => 0
opcache.max_wasted_percentage => 5 => 5
opcache.memory_consumption => 128 => 128
opcache.opt_debug_level => 0 => 0
opcache.optimization_level => 0x7FFFBFFF => 0x7FFFBFFF
opcache.preferred_memory_model => no value => no value
opcache.protect_memory => 0 => 0
opcache.restrict_api => no value => no value
opcache.revalidate_freq => 2 => 2
opcache.revalidate_path => Off => Off
opcache.save_comments => 1 => 1
opcache.use_cwd => On => On
opcache.validate_permission => Off => Off
opcache.validate_root => Off => Off
opcache.validate_timestamps => On => On
Btw, I have to say I never noticed a huge difference on prod with apache when switched from PHP 5 to PHP 7. Despites all of the bechmarks we see online, the difference is far from obvious.
Neddless to say, for that project, I will stick to PHP 5 version.