A
A
Artyom2015-09-08 09:15:02
Server optimization
Artyom, 2015-09-08 09:15:02

How to optimize the server for 1000 requests every minute?

Hello. Every minute, cron runs one script, which calls about 1000 scripts through cURL multithreading (more precisely, one script, different IDs). On average, processing one request takes from 5 to 30 seconds. No matter how much the tariff is increased, it cannot cope with a large number of requests. You have to use about 4 VPS, which is quite difficult. Tell me how to optimize? PHP scripts.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
H
HaruAtari, 2015-09-08
@DeOne

Running a script is a relatively time-consuming thing. Try to pass id-shniks to scripts not one at a time, but in batches, and process them in a cycle in the script.
But here you need to look logically at what exactly the script does and how you can optimize its logic of work. For example, to cache results of a selection from a database. Write results once at the end of the query instead of one at a time (if possible). What version of PHP is it, is the code byte cache enabled?

ТыжСисАдмин, 2015-09-08
@POS_troi

Как вы предлагаете что-то вам советовать не видя собственно виновника вопроса и не понимаю что вообще происходит?

R
Román Mirilaczvili, 2015-09-08
@2ord

Почитайте материалы про сервер очередей:

  1. очередь-сообщений-что-это-и-зачем
  2. Тостер: Gearman – фреймворк для распределения задач, введение
  3. Какой сервер очередей использовать?
    Мне кажется данный совет будет наиболее правильным для данной задачи.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question