PHP + Sybase ASE 12.5 (over FreeTDS 0.82-r2)
hexes 16 апреля, 2009 - 14:38
Вообщем есть Gentoo c PHP&FreeTDS (из FreeTDS - tsql всё работает замечательно и ХП и простые запросы, быстро и хорошо), из под РНР (уже исключил Апач, запускаю в консоли) селект на 1 строку ещё приемлемо работает (учитывая Р166 и 96Мб). Но если возвращается хотя бы 2 строки это дело виснет колом...
Скрипт умирает по таймауту 120 сек., по нехватке памяти (причём я ему даю 32мб., а он пытается выделить к примеру 320кб)... И прочие непонятки...
Apache написал(а):
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 79 bytes) in /var/www/localhost/htdocs/ppp.php on line 12
Вот и фиг пойми...
Ещё одна забавность:
уж не знаю как должно быть, но явно не так, с одного запроса к базе (МАЛЕНЬКОГО! на 2-3 строки) лог FreeTDSа опух на 19,9 Мб.
Пытаюсь его читать, жду советов/идей...
Вообщем разница в логах присутствует (при нормальном запросе на 1 строку он весит 32кб)
плохой лог написал(а):
net.c:779:Sending packet 0000 0f 01 00 38 00 00 00 00-21 2b 00 00 00 00 53 45 |...8.... !+....SE| 0010 4c 45 43 54 20 2a 20 46-52 4f 4d 20 53 68 6f 77 |LECT * F ROM Show| 0020 20 57 48 45 52 45 20 69-64 73 68 6f 77 20 3e 3d | WHERE i dshow >=| 0030 20 34 36 30 30 31 33 30- | 4600130| dblib.c:4532:dbsqlok(0x831b830) net.c:592:Received header 0000 04 00 02 00 00 00 00 00- |........| net.c:671:Received packet 0000 ee 72 01 14 00 06 49 64-53 68 6f 77 40 7d 00 00 |.r....Id Show@}..| 0010 00 6c 05 09 00 00 0a 49-64 53 68 6f 77 54 79 70 |.l.....I dShowTyp| 0020 65 10 81 00 00 00 2f 02-00 08 50 72 6f 64 75 63 |e...../. ..Produc| 0030 65 72 30 68 00 00 00 27-24 00 07 50 61 69 6e 74 |er0h...' $..Paint| 0040 65 72 30 68 00 00 00 27-24 00 0b 44 65 73 63 72 |er0h...' $..Descr| 0050 69 70 74 69 6f 6e 30 6a-00 00 00 27 fe 00 06 52 |iption0j ...'...R| 0060 65 6d 61 72 6b 30 71 00-00 00 23 00 fc 00 00 04 |emark0q. ..#.....| 0070 00 53 68 6f 77 00 04 4e-61 6d 65 10 68 00 00 00 |.Show..N ame.h...| 0080 27 24 00 08 44 75 72 61-74 69 6f 6e 30 8f 00 00 |'$..Dura tion0...| 0090 00 26 04 00 0c 50 72 65-6d 69 65 72 65 44 61 74 |.&...Pre miereDat| 00a0 65 30 90 00 00 00 6f 08-00 05 4b 44 4d 54 50 30 |e0....o. ..KDMTP0| ...бла-бла-бла-заголовки... dblib.c:4556:dbsqlok() exits on result token 0xee dblib.c:1599:dbresults(0x831b830) dblib.c:1608:dbresults: dbresults_state is 0 (_DB_RES_INIT) token.c:495:tds_process_tokens(0x831c6e8, 0xbfa61704, 0xbfa61708, 0x6914) util.c:162:Changed query state from PENDING to READING token.c:510:processing result tokens. marker is ee(RESULT) mem.c:563:tds_free_all_results() token.c:1596:processing result. type = 108(numeric), varint_size 1 token.c:1617:processing result. column_size 5 token.c:1596:processing result. type = 47(char), varint_size 1 token.c:1617:processing result. column_size 2 token.c:1596:processing result. type = 39(varchar), varint_size 1 token.c:1617:processing result. column_size 36 token.c:1596:processing result. type = 39(varchar), varint_size 1 token.c:1617:processing result. column_size 36 token.c:1596:processing result. type = 39(varchar), varint_size 1 token.c:1617:processing result. column_size 254 token.c:1596:processing result. type = 35(text), varint_size 4 token.c:1617:processing result. column_size 64512 token.c:1596:processing result. type = 39(varchar), varint_size 1 token.c:1617:processing result. column_size 36 ...бла-бла-бла... util.c:162:Changed query state from READING to PENDING dblib.c:1630:dbresults() tds_process_tokens returned 1 (TDS_SUCCEED), result_type TDS_ROWFMT_RESULT token.c:495:tds_process_tokens(0x831c6e8, 0xbfa61704, 0xbfa61708, 0x6914) util.c:162:Changed query state from PENDING to READING token.c:510:processing result tokens. marker is ae(CONTROL) token.c:108:tds_process_default_tokens() marker is ae(CONTROL) token.c:223:Eating CONTROL token token.c:510:processing result tokens. marker is d1(ROW) token.c:621:tds_process_tokens::SET_RETURN stopping on current token util.c:162:Changed query state from READING to PENDING dblib.c:1630:dbresults() tds_process_tokens returned 1 (TDS_SUCCEED), result_type TDS_ROW_RESULT dblib.c:1587:dbresults returning 1 (SUCCEED) dblib.c:1948:dbnextrow(0x831b830) dblib.c:1961:dbnextrow() dbresults_state = 2 (_DB_RES_RESULTSET_ROWS) token.c:495:tds_process_tokens(0x831c6e8, 0xbfa61708, (nil), 0x1508) util.c:162:Changed query state from PENDING to READING token.c:510:processing result tokens. marker is d1(ROW) token.c:2166:tds_process_row(): reading column 0 token.c:1915:tds_get_data: type 108, varint size 1 token.c:1975:tds_get_data(): wire column size is 5
хороший лог написал(а):
net.c:779:Sending packet 0000 0f 01 00 38 00 00 00 00-21 2b 00 00 00 00 53 45 |...8.... !+....SE| 0010 4c 45 43 54 20 2a 20 46-52 4f 4d 20 73 68 6f 77 |LECT * F ROM show| 0020 20 57 48 45 52 45 20 69-64 73 68 6f 77 20 3e 20 | WHERE i dshow > | 0030 34 36 30 30 31 31 30 0a- |4600110.| token.c:495:tds_process_tokens(0x807db80, 0xbfc5a19c, (nil), 0x6914) util.c:162:Changed query state from PENDING to READING net.c:592:Received header 0000 04 00 02 00 00 00 00 00- |........| net.c:671:Received packet 0000 ee 72 01 14 00 06 49 64-53 68 6f 77 40 7d 00 00 |Нr....Id Show@}..| 0010 00 6c 05 09 00 00 0a 49-64 53 68 6f 77 54 79 70 |.l.....I dShowTyp| 0020 65 10 81 00 00 00 2f 02-00 08 50 72 6f 64 75 63 |e.│.../. ..Produc| 0030 65 72 30 68 00 00 00 27-24 00 07 50 61 69 6e 74 |er0h...' $..Paint| 0040 65 72 30 68 00 00 00 27-24 00 0b 44 65 73 63 72 |er0h...' $..Descr| 0050 69 70 74 69 6f 6e 30 6a-00 00 00 27 fe 00 06 52 |iption0j ...'Ч..R| 0060 65 6d 61 72 6b 30 71 00-00 00 23 00 fc 00 00 04 |emark0q. ..#.Э...| 0070 00 73 68 6f 77 00 04 4e-61 6d 65 10 68 00 00 00 |.show..N ame.h...| 0080 27 24 00 08 44 75 72 61-74 69 6f 6e 30 8f 00 00 |'$..Dura tion0▐..| 0090 00 26 04 00 0c 50 72 65-6d 69 65 72 65 44 61 74 |.&...Pre miereDat| ...бла-бла-бла-заголовки... token.c:510:processing result tokens. marker is ee(RESULT) mem.c:563:tds_free_all_results() token.c:1596:processing result. type = 108(numeric), varint_size 1 token.c:1617:processing result. column_size 5 token.c:1596:processing result. type = 47(char), varint_size 1 token.c:1617:processing result. column_size 2 token.c:1596:processing result. type = 39(varchar), varint_size 1 token.c:1617:processing result. column_size 36 token.c:1596:processing result. type = 39(varchar), varint_size 1 token.c:1617:processing result. column_size 36 token.c:1596:processing result. type = 39(varchar), varint_size 1 token.c:1617:processing result. column_size 254 token.c:1596:processing result. type = 35(text), varint_size 4 token.c:1617:processing result. column_size 64512 token.c:1596:processing result. type = 39(varchar), varint_size 1 token.c:1617:processing result. column_size 36 token.c:1596:processing result. type = 38(integer-null), varint_size 1 token.c:1617:processing result. column_size 4 token.c:1596:processing result. type = 111(datetime-null), varint_size 1 token.c:1617:processing result. column_size 8 token.c:1596:processing result. type = 38(integer-null), varint_size 1 ...бла-бла-бла... util.c:162:Changed query state from READING to PENDING token.c:495:tds_process_tokens(0x807db80, 0xbfc5a19c, (nil), 0x6914) util.c:162:Changed query state from PENDING to READING token.c:510:processing result tokens. marker is ae(CONTROL) token.c:108:tds_process_default_tokens() marker is ae(CONTROL) token.c:223:Eating CONTROL token token.c:510:processing result tokens. marker is d1(ROW) token.c:621:tds_process_tokens::SET_RETURN stopping on current token util.c:162:Changed query state from READING to PENDING token.c:495:tds_process_tokens(0x807db80, 0xbfc5a19c, (nil), 0x1508) util.c:162:Changed query state from PENDING to READING token.c:510:processing result tokens. marker is d1(ROW) token.c:2166:tds_process_row(): reading column 0 token.c:1915:tds_get_data: type 108, varint size 1 token.c:1975:tds_get_data(): wire column size is 5 token.c:2166:tds_process_row(): reading column 1 token.c:1915:tds_get_data: type 47, varint size 1 token.c:1975:tds_get_data(): wire column size is 2 token.c:2166:tds_process_row(): reading column 2 token.c:1915:tds_get_data: type 39, varint size 1 token.c:1975:tds_get_data(): wire column size is 11 token.c:2166:tds_process_row(): reading column 3
»
- Для комментирования войдите или зарегистрируйтесь
тема ап...
тема ап...