Pulp
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Help
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
1
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# Pulp content serving Performance Test ## Goals 1. Characterize the relationship between sustained requests / sec to the pulp-content app and the number of pulp-content apps without increases in latency. 2. Identify rate limiting components in various test scenarios. ## System Under Test ### Physical hardware All in EU-West-2 1 Load generator - m4.2xlarge instance: * 8 64-bit CPUs, Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz * 32GB Ram 1 Pulp test machine - m4.2xlarge instance: * 8 64-bit CPUs, Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz * 32GB Ram Minio providing artifact storage also running on the system under test. ### Software Under Test Pulp will be deployed as containers on the "Pulp Test Machine" hardware above: * 1 container for pulp-api * N containers for pulp-content * 2 containers for pulp-worker * 1 redis container * 1 postgresql container Pulp will be configured to Mini which is also deployed on the same machine as Pulp. These artifacts aren't going to actuall be served during testing, so this is expected to use a minimum amount of hardware resources on the system under test. The versions under test are: pulpcore 3.22.0 and pulp_rpm 3.18.9 ### Architecture Components: * The load generator ([locust](https://locust.io/) with fasthttp backend) * The pulp-content processes Locust ---HTTP-Requests---> pulpcore-content Locust <---302-Redirect--- pulpcore-content Locust will not follow the redirect. Mini is not the software under test, only pulp-content is. The reverse proxy is entirely bypassed as we do not want to test nginx, only Pulp. ### Locust configuration Deployed with 16 workers on the load generator machine. The urls from the RHEL9 baseos are gathered into a text file using this script: ``` import argparse import requests from bs4 import BeautifulSoup from urllib.parse import urljoin def process_page(url): page = requests.get(url) soup = BeautifulSoup(page.content, "html.parser") links = soup.find_all("a") for link in links: if link.text == "../": continue link_url = urljoin(url, link["href"]) if link_url.endswith(".rpm"): print(link_url) elif "://" in link_url: process_page(link_url) parser = argparse.ArgumentParser(description='Get the full URLs of .rpm files at a specific url.') parser.add_argument('base_url', help='The base url to fetch links from') args = parser.parse_args() base_url = args.base_url process_page(base_url) ``` Here is the locustfile.py ``` import random import re import time from locust import FastHttpUser, task NUM_CONTENT_APPS = 2 START_PORT = 24737 END_PORT = START_PORT + NUM_CONTENT_APPS class QuickstartUser(FastHttpUser): def on_start(self): with open("/mnt/locust/urls.txt") as file: self.urls = file.readlines() @task def random_rpm(self): original_url = random.choice(self.urls) new_port = str(random.randint(START_PORT, END_PORT - 1)) new_url = re.sub(r':\d+', ':' + new_port, original_url) self.client.get( new_url, allow_redirects=False ) ``` ### Metrics * sustained requests / sec - The number of redirects issued per second. * latency median - Pulp's most typical respose time. * latency 95th percentiles paired with the requests / sec - Pulp's majority case response time. * redis container CPU percentage - An indicator of how heavily loaded Redis is. * PostgreSQL Process count - An indicator of how heavily loaded PostgreSQL is. It forks more when postgreSQL is processing more load. * PostgreSQL average CPU usage across all PostgreSQL processes. - An indicator of how heavily loaded postgreSQL is. * Number of pulp-content Gunicorn workers. In practice, how many did gunicorn fork. - Indicates the actual number of processes handling requests. * Average pulp-content Gunicorn workers CPU. Averaged across all the pulp-content gunicorn workers. - An indiciator of how heavily loaded the pulp-content processes are. ## Scenarios For each scenario increase the number of Locust users until the pulp-content app no longer shows increases in req/sec with additional increases in locust users. 1. 1 pulp-content process (2 gunicorn processes when heavily loaded). Redis caching enabled. 2. 2 pulp-content process (4 gunicorn processes when heavily loaded). Redis caching enabled. 3. 4 pulp-content process (8 gunicorn processes when heavily loaded). Redis caching enabled. This is the maximum number of cpus on the machine. 4. 2 pulp-content process (4 gunicorn processes when heavily loaded). Redis caching disabled. This is useful for comparing against scenario (2) to determine the impact of caching. ## Caching Enabled Results 1. Each pulp-content gunicorn worker process having exclusive access to an idle 2.50GHz Xeon CPU can serve 625 req / sec. 2. The pulp-content gunicorn worker process uses a stable 16MB each. 3. The pulp-content gunicorn worker is CPU bound with CPU directly correlating to req / sec. 4. A single container Redis was able to serve about 3K req / sec with 20% CPU in use. 5. postgreSQL was almost entirely unloaded and never spawned more than 1 process and never even registered on top during any caching-enabled run. 6. The maximum median response time in almost all runs was 25ms. 7. The 95th percentile response time in almost all runs was 70ms. ## Caching Disable Results 1. Each pulp-content gunicorn worker process having exclusive access to an idle 2.50GHz Xeon CPU can serve 108 req / sec. 2. The pulp-content gunicorn worker process uses a stable 16MB each. 3. The pulp-content gunicorn worker is both 3/4 CPU and 1/4 DB bound with both resources closely correlating to req / sec. 4. postgreSQL forked workers and began loading them. 6. The maximum median response time in almost all runs was 16ms. 7. The 95th percentile response time in almost all runs was 28ms. ## Conclusions 1. Using Redis caching for Pulp should allow for a cluster to horizontally scale to the size most if not all req / sec rates. * In doing so, just add more CPU for additional pulp-content processes * Make sure your Redis also doesn't run out of CPU. You could horizontally scale this component too. * The response times are well within the 2 second yum/dnf response timeout, which should ensure their redirects at least without any issue. ### Appendix A: Test Setup Sync with policy="immediate" a RHEL9 baseos. To do this: 1. Create a debug CDN cert with [these instructions](https://source.redhat.com/groups/public/release-engineering/release_engineering_rcm_wiki/how_to_generate_cdn_debug_certs). 2. Create and sync rhel9 baseos with these commands ``` pulp rpm remote create --name rhel9_baseos --url https://cdn.redhat.com/content/dist/rhel9/9/x86_64/baseos/os/ --policy immediate --client-cert @cdn_1056.pem --client-key @cdn_1056.pem --ca-cert @redhat-uep.pem pulp rpm repository create --name rhel9_baseos --autopublish --remote rhel9_baseos pulp rpm distribution create --base-path rhel9_baseos --name rhel9_baseos --repository rhel9_baseos pulp rpm repository sync --name rhel9_baseos ``` ### Appendix B: Notes #### Commands on system under test Install docker https://docs.docker.com/engine/install/fedora/#install-using-the-repository sudo dnf install docker-compose git setup portainer via docker-compose setup pulp via docker compose install minio and configure pulp to talk to it Make sure to create the bucket manually for pulp to use also #### Commands on load generator Install docker https://docs.docker.com/engine/install/fedora/#install-using-the-repository sudo dnf install docker-compose setup portainer via docker-compose setup locust via docker-compose https://docs.locust.io/en/stable/running-in-docker.html

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully