Redian新闻
>
为什么最近euro跌得很厉害,而美元能保持平稳,
avatar
为什么最近euro跌得很厉害,而美元能保持平稳,# Economics - 经济
a*s
1
本地:php+apache server.
问题是:我用php远程连接到postgre数据库,然后把返回的数据显示到本地的页面。有
的query要运行1个多小时,返回的数据很小。我已经设了php的max_timeout =36000.
当postgre比较繁忙的时候,我的程序就有可能在运行了1两个小时后死掉(就是页面
停止了运行)。同样的程序在不繁忙的时候就可以运行完。
大家觉得是要改apache的配置么?怎么解决这个问题? 先谢过
avatar
w*e
2
美元对rmb什么时候再跌
avatar
f*y
3
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.
avatar
n*r
4
TV commentator (BBC ? or PBS ?) said it is because Europe is in worse shape
than US.
People also go to safer Yen(Japan).
I personally believe Yuang(China) will follow US$, maybe fall but not not
rise, because export will be dead if rise, and US is not pushing anymore.
avatar
a*s
5
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.

avatar
f*y
6
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?
avatar
a*s
7
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?

avatar
m*t
8

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.

avatar
f*Q
9
refresh every 60 seconds.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。