Skip to content

A trivial HTTP server that eats CPU cycles or memory at each request.

Notifications You must be signed in to change notification settings

otomato-gh/busyhttp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

busyhttp.py

This repo provides a simple Flask web application that simulates CPU and memory load for testing purposes.

This app was originally created by @jpetazzo for container.training and further developed by @antweiss for additional use cases.

Routes:

  • /cpu
      Simulates CPU load for 1 second.
    
  • /cpu/<int:seconds>
      Simulates CPU load for a specified number of seconds using multiprocessing.
    
  • /memory/<int:mb>
      Allocates a specified number of megabytes of memory and holds it for 1 second.
    
  • /memfree/<int:mb>
      Releases a specified number of megabytes of memory if available.
    
  • /memory
      Allocates 1 megabyte of memory and holds it for 1 second.
    
  • /memfree
      Releases 1 megabyte of memory if available.
    

Classes:

  • memBuf
      A class that contains a static buffer list used to simulate memory allocation.
    

About

A trivial HTTP server that eats CPU cycles or memory at each request.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 92.2%
  • Dockerfile 7.8%