dongnao2582 2012-08-20 06:05
浏览 45

为什么PHP脚本在新服务器上的执行时间长?

I have a server that has 2 quad core processors (2.4 GHz, 16GB RAM). I have a some PHP scripts that run under very heavy load. Most of these scripts do few things:

  1. Fetch Data from database (just a single row, from a small table)
  2. Fetch Data from other server (mainly Facebook)
  3. Upload a small photo
  4. Update Database table (this table is very heavily used, and number of rows grows very quickly, almost 2 rows per second)

The problem is that, the scripts are taking too much time to execute. I had a server previously which has lower configuration (one quad core processor, 6GB RAM), but scripts took 4-5 sec to complete. But now, execution time is 30-40sec, even more.

HOW I MEASURE EXECUTION TIME? I measure microtime() at start of script and end of script and subtract them. I just needed a rough estimate.

SERVER CONFIGURATION: Here are some parameters set in apache config:

server_limit = 350
max_chlid = 350
keep_alive = off

Other Characteristics: 1. When server is not under heavy load, execution time is very small 2. Previous server took very less time to execute, even under heavy load

I don't know what else details should I include. Please ask me, and I will post them here.

What should I do to improve this?

Update:

I have figured out the problem is with ImageMagick library. I googled and tried few soution like disabling OpenMP. But it hasn't helped much

  • 写回答

3条回答 默认 最新

  • dqd72925 2012-08-20 06:14
    关注

    This could have many reasons:

    1. Are your queries "slow"?
    2. Is the server configuration right?
    3. Has it a slow bandwidth?
    4. Is MySql-Server configuration right?
    5. What is the format of the table you insert?
    6. Is something else (a cronjob e.g.) killing the database?

    I would post this as a comment, but unfortunatly i can't please clear up those questions and tell what you find out ;)

    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题