由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - php+apache timeout 的问题
相关主题
Querying JSON in Postgres问一个同步问题
Mac or IBM laptop for java programming? Thank you!!!问一道面试题
连续变化的地理位置的querySQL server optimal query design (转载)
各路大神推荐个linux上的组合吧MongoDB快超过Postgres了
Postgresql 相关的几个slides熟悉postgre sql的請問,RULEs大家用的多麽
VC6.0 补丁??postgres 值得学吗?
Google Index machine kills serveruber从postgre转回mysql了
big data,菜凉?Uber 数据库大变动?
相关话题的讨论汇总
话题: php话题: apache话题: timeout话题: database话题: 运行
进入Programming版参与讨论
1 (共1页)
a*******s
发帖数: 324
1
本地:php+apache server.
问题是:我用php远程连接到postgre数据库,然后把返回的数据显示到本地的页面。有
的query要运行1个多小时,返回的数据很小。我已经设了php的max_timeout =36000.
当postgre比较繁忙的时候,我的程序就有可能在运行了1两个小时后死掉(就是页面
停止了运行)。同样的程序在不繁忙的时候就可以运行完。
大家觉得是要改apache的配置么?怎么解决这个问题? 先谢过
f**y
发帖数: 138
2
why not run your php script in the shell instead of inside apache? Let it
write the result back to DB and let your web page poll the result
periodically.
a*******s
发帖数: 324
3
I only has the "select" privilege in the database.
Thanks anyway.

【在 f**y 的大作中提到】
: why not run your php script in the shell instead of inside apache? Let it
: write the result back to DB and let your web page poll the result
: periodically.

f**y
发帖数: 138
4
apache has 'Timeout' config option, usually default to 120 seconds. Never
thought one can maintain the connection for hours.
Can your php script write the result to a temporary file?
a*******s
发帖数: 324
5
http://httpd.apache.org/docs/1.3/mod/core.html#timeout
The php is installed in the local machine not on the database server. I can
do nothing except fetching the results from the database.

【在 f**y 的大作中提到】
: apache has 'Timeout' config option, usually default to 120 seconds. Never
: thought one can maintain the connection for hours.
: Can your php script write the result to a temporary file?

m******t
发帖数: 2416
6

can
The first thing I'd look at is to see if those queries really have to take
that long - are the tables properly indexed? Can the queries be optimized or
broken down to sevenral faster ones?
If you've done all the optimizations and they still take very long, I'd
consider making them asynchronous. For instance, kick it off in a background
process, write the results into a temp file, and let the user keep polling
the status (or have the background process send the user an email when it's
done).

【在 a*******s 的大作中提到】
: http://httpd.apache.org/docs/1.3/mod/core.html#timeout
: The php is installed in the local machine not on the database server. I can
: do nothing except fetching the results from the database.

f*****Q
发帖数: 1912
7
refresh every 60 seconds.
1 (共1页)
进入Programming版参与讨论
相关主题
Uber 数据库大变动?Postgresql 相关的几个slides
Windows下大家都用什么SqlConsole啊?VC6.0 补丁??
question about using Hive parameter (转载)Google Index machine kills server
Do the two statements cost the same amount of time?big data,菜凉?
Querying JSON in Postgres问一个同步问题
Mac or IBM laptop for java programming? Thank you!!!问一道面试题
连续变化的地理位置的querySQL server optimal query design (转载)
各路大神推荐个linux上的组合吧MongoDB快超过Postgres了
相关话题的讨论汇总
话题: php话题: apache话题: timeout话题: database话题: 运行