Find Jobs
Hire Freelancers

slowly, skipping seconds script sends a massive number of updates to the database

RM99-825 MYR

En curso
Publicado hace más de 8 años

RM99-825 MYR

Pagado a la entrega
The site was responding slowly and skipping seconds because the script public_html/[login to view URL], which runs every 5 minutes, sends a massive number of updates to the database in an unrestrained while loop. This causes MySQL to consume a huge amount of disk IO, however the script is pushing the queries faster than MySQL can write tot he disk. This causes one of the CPU cores to be fully consumed by disk IO, and no disk IO available to anything else. This causes load to increase, and everything else on the server to begin to run slowly. I backed that script up, and put a 150000 microsecond delay in between database updates, on line 133. This still allows for it to function fairly quickly, but without trashing the disk and spiking load on the server on its own. I also noticed that that script has no replication control. It should be modified check if it is already running, and to only run if it is not running. The cron runs the script every 5 minutes, but it may take longer for 5 minutes for the script to complete. This causes multiple copies of it to be running at the same time, as new ones are spawned before the old ones finish. When there are multiple copies of this running simultaneously, it overloads MySQL with too many updates, and again causes the issue. I've changed the IO scheduler to one which should allow more IO to other processes. This and putting the light sleep in the script is allowing the server to remain fairly responsive, and the site is loading quickly at this time. I would highly recommend implementing some logic in the script to prevent it from running more than one instance, and possibly even reducing the cron frequency of it
ID del proyecto: 8683618

Información sobre el proyecto

Proyecto remoto
Activo hace 9 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos

Sobre este cliente

Bandera de MALAYSIA
Kuching, Malaysia
5,0
1
Forma de pago verificada
Miembro desde ago 18, 2015

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.