Automattic / Automattic/jetpack

Protect: improve performance of requests to the Protect API

Open
#30,933 3 comments 0 reactions 0 assignees View on GitHub
[Feature] Protect [Focus] Performance [Plugin] Jetpack [Plugin] Protect [Pri] Normal Enhancement
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

### Impacted plugin

Protect

### What

Using website with Jetpack Protect is slow in US rush hours

### How

I was debugging a site that has been extremally slow during USA business hours. The site itself has not been receiving almost any traffic, server load was low etc.. In other hours, it has been working okay.

![image](https://github.com/Automattic/jetpack/assets/315648/bcfc2a9e-d4f4-4c94-9879-3b354b74180a)

XDebug has traced this to be caused by curl HTTP requests by Jetpack and Astra. Disabling Jetpack and the offending features of Astra helped.

It seems that these days, it's possible to use [asynchronous execution for HTTP](https://stackoverflow.com/questions/962915/how-do-i-make-an-asynchronous-get-request-in-php/13545561#13545561) - even in PHP. Would you consider using this to not slow down your users' websites when your server gets slow?

Contributor guide

Open the contributing guide

Research direction

Start by identifying the Jetpack Protect curl HTTP requests described in the report and profiling their effect when the Protect API is slow during US business hours. Compare the current synchronous behavior with the proposed asynchronous approach; done should mean slow Protect API responses no longer make users' websites slow. The issue names no files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
api, backend, performance
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.