doulianglou0898 2014-12-07 18:47
浏览 54

PHP On EC2挂起

New WinDBG call stack. Seems to be MySQL related.

---UPDATE---

On Windows Server 2012, using Java 7, and PHP 5.3.29 on Amazon EC2 I run a Java program that launches I pretty simple PHP script (can't show since it depends on multiple dependencies - a lot of code). PHP script just gets something from mysql and emails me if something goes wrong.

This PHP script does not exit! I call exit(); at the end of PHP file. The Java code that starts this as a sub-process, redirects error stream to inputstream, so there is no infamous buffer deadlock that should be going on. Procmon shows no PHP.exe activity whatsoever.

Picture of the process (about 2 hours long - 4:51PM UTC):

enter image description here

Picture showing 0 CPU usage:

enter image description here

Picture showing that the process lasted only about 1 second:

enter image description here

The last picture is the one I am most concerned about, my scripts last about 10 seconds, not under 1 second!

Process Explorer PHP.exe stack:

ntoskrnl.exe!KeSynchronizeExecution+0x2246
ntoskrnl.exe!KeRemoveQueueEx+0x108e
ntoskrnl.exe!KeRemoveQueueEx+0xae9
ntoskrnl.exe!KeWaitForMutexObject+0x22a
ntoskrnl.exe!KeSetBasePriorityThread+0x4ec
ntoskrnl.exe!KeRemoveQueueEx+0x281d
ntoskrnl.exe!KeRemoveQueueEx+0x121a
ntoskrnl.exe!KeRemoveQueueEx+0xae9
ntoskrnl.exe!KeWaitForMutexObject+0x22a
ntoskrnl.exe!NtWaitForSingleObject+0xb2
ntoskrnl.exe!setjmpex+0x34b3
wow64cpu.dll!TurboDispatchJumpAddressEnd+0x598
wow64cpu.dll!TurboDispatchJumpAddressEnd+0x3e4
wow64.dll!Wow64LdrpInitialize+0x22e
wow64.dll!Wow64LdrpInitialize+0x172
ntdll.dll!LdrInitShimEngineDynamic+0x2383
ntdll.dll!memset+0xf36a
ntdll.dll!LdrInitializeThunk+0xe
ntdll.dll!ZwWaitForSingleObject+0xc
mswsock.dll!NSPStartup+0x298
WS2_32.dll!select+0x17d
ntdll.dll!RtlAllocateHeap+0xca

PHP.exe dump file analyzed calls stack:

00 ntdll!NtWaitForSingleObject+0xc
01 mswsock!SockWaitForSingleObject+0x154
02 mswsock!WSPSelect+0x355
03 ws2_32!select+0x17d
04 php5ts!php_poll2+0x1e0
05 php5ts!php_stream_xport_create+0x371e
06 php_openssl!get_module+0x9b39
07 php5ts!php_stream_alloc+0x3f4
08 php5ts!php_stream_fill_read_buffer+0x2a4
0a php5ts!php_mysqlnd_net_network_read_pub+0x4b
0b php5ts!php_mysqlnd_net_receive_pub+0x149
0c php5ts!php_mysqlnd_read_row_ex+0x9c
0d php5ts!php_mysqlnd_rowp_read+0x4d
0e php5ts!php_mysqlnd_res_store_result_fetch_data_pub+0x21f
0f php5ts!php_mysqlnd_res_store_result_pub+0xc0
10 php5ts!php_mysqlnd_conn_store_result_pub+0x160
11 php_mysqli!zif_mysqli_query+0x2e2
12 php5ts!zend_do_fcall_common_helper_SPEC+0x8af
13 php5ts!ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER+0xd
14 php5ts!execute+0x2e8
15 php5ts!zend_execute_scripts+0xfe
16 php5ts!php_execute_script+0x24c
17 php!main+0xc1b
18 php!__tmainCRTStartup+0x10f
19 kernel32!BaseThreadInitThunk+0xe
1a ntdll!__RtlUserThreadStart+0x20
1b ntdll!_RtlUserThreadStart+0x1b

Can anyone recommend the next course of action or maybe you experienced this before? Thanks!

The script:

<?php
error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
require_once('common.php');
DB::overwriteInstanceWithHost('db'); // exists in hosts
date_default_timezone_set("UTC");
DB::overrideCommonDBWithHost("common.db.com"); // not real, but exists
$fetcher = new DataFetcher();
$weatherData = $fetcher->fetchByLatLng(latHere,longHere);
if($weatherData){
    echo $weatherData->getCity();
} else {
    echo "couldn't get station lat/lng";
}
exit();
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 谁有desed数据集呀
    • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
    • ¥15 关于#hadoop#的问题
    • ¥15 (标签-Python|关键词-socket)
    • ¥15 keil里为什么main.c定义的函数在it.c调用不了
    • ¥50 切换TabTip键盘的输入法
    • ¥15 可否在不同线程中调用封装数据库操作的类
    • ¥15 微带串馈天线阵列每个阵元宽度计算
    • ¥15 keil的map文件中Image component sizes各项意思
    • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏