达到极限 [英] hitting the limits

查看:69
本文介绍了达到极限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Folk


我正在管理一个网站, www.friars.co.nz 似乎达到了极限

并且我一直得到500错误。据webfarm的人说,它是因为我的剧本要求太高或者没有正确关闭。


我不相信你必须关闭 PHP脚本甚至是数据库连接。


该网站还可以访问80兆字节的数据库。


你知道我能找到的方法吗?哪里出现问题或改善网站的性能?


我使用ob_start和ob_end_flush会不会导致问题?

TIA

Hi Folk

I am managing a site, www.friars.co.nz that seems to be hitting the limits
and I keep getting the 500 error. According to the people from webfarm it
is because my script are too demanding or not closed properly.

I dont believe you have to "close" PHP scripts or even database connections.

The site also accesses a 80 Megabyte database.

Do you know of a way I can find out where the problems are or improving the
performance of the site?

I uses ob_start and ob_end_flush, would that cause problems?

TIA

Nicolaas


推荐答案

windandwaves写道:
windandwaves wrote:
嗨民俗

我正在管理一个网站, www .friars.co.nz 似乎达到了极限
并且我一直收到500错误。据webfarm的人说,这是因为我的剧本要求太高或者没有正确关闭。

我不相信你必须关闭它。 PHP脚本甚至是数据库连接。

该站点还可以访问80兆字节的数据库。

您是否知道我可以找到问题所在或改进的方法<网站的性能如何?

我使用ob_start和ob_end_flush,会不会引起问题?



Hi Folk

I am managing a site, www.friars.co.nz that seems to be hitting the limits
and I keep getting the 500 error. According to the people from webfarm it
is because my script are too demanding or not closed properly.

I dont believe you have to "close" PHP scripts or even database connections.

The site also accesses a 80 Megabyte database.

Do you know of a way I can find out where the problems are or improving the
performance of the site?

I uses ob_start and ob_end_flush, would that cause problems?

TIA

Nicolaas





嗯,ob_start和ob_end_flush需要系统资源;页面越大

它需要的资源越多。


您可能没有使用它的许多资源。你可能会用很多东西。这一切

取决于网站以及您使用它的目的。

-

======== ==========

删除x来自我的电子邮件地址

Jerry Stuckle

JDS计算机培训公司
js ******* @ attglobal.net

==================



Well, ob_start and ob_end_flush require system resources; the bigger the page
the more resources it requires.

You might not be using many resources with it. You may be using a lot. It all
depends on the site and what you''re using it for.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================


windandwaves写道:
windandwaves wrote:
我正在管理一个网站, www.friars.co.nz 似乎达到了
限制,我不断收到500错误。据webfarm的人们说,这是因为我的脚本要求太高了b $ b

我不是服务器管理员,但也许你可以问他们最苛刻的是什么? />
请求是?

或未正确关闭

我不相信你必须关闭 PHP脚本


据我所知,没有。

甚至数据库
连接。


通常没有。

如果您的资源被拉长,可能需要检查一下您的

脚本是否打开(并且只有一次)每个请求连接到数据库,

提取所有需要的数据,然后关闭连接,之后是

继续进一步处理。如果您的网站很受欢迎,那么使用持久数据库连接可能会获得


在很大程度上取决于您使用的脚本和连接。


我可能会在这里谈论我的屁股,遗憾的是我从未遇到如此受欢迎的问题:-)。

该站点还可访问80兆字节的数据库。


Phah!与我以前的情况相比,这是巨大的。

我认为你已经规范化了数据库?

创建适当的索引以便更快地选择?

您是否了解我可以找到问题所在的方法或改善网站性能?


要检查脚本需要多少时间(可能还有资源),请在本地服务器(100个地方)上多次循环

或者更多)和

代码中的特定位置添加以下内容:


一开始:
I am managing a site, www.friars.co.nz that seems to be hitting the
limits and I keep getting the 500 error. According to the people
from webfarm it is because my script are too demanding
I''m no server admin, but maybe you can ask them what the most demanding
requests are?
or not closed
properly.

I dont believe you have to "close" PHP scripts
Not to my knowledge, no.
or even database
connections.
Normally no.
If your resources are stretched, it may be worth it to check wether your
script opens once (and only once) a connection to the database per request,
extracts all needed data, and then closes the connection, after which is
continues further processing. If your website is that popular, maybe there
is something to gain from using a persistent database connection, that
highly depends on your used scripts and connections.

I might be talking out of my ass here, I''ve unfortunately never had the
problem of being so popular :-).
The site also accesses a 80 Megabyte database.
Phah! That''s huge compared to what I''m used to.
I assume you''ve normalized the database?
Created proper indexes for faster selecting?
Do you know of a way I can find out where the problems are or
improving the performance of the site?
To check how much time (and probably resource) your script takes, loop over
it a couple of times on a local server (somewhere in the 100 or more), and
on specific places in your code add the following:

At the start:

start = microtime(true);


在脚本中的关键位置,您想知道所花费的时间。
start = microtime(true);

At key locations in the script you want to know the time taken.


这篇关于达到极限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆