PHPackages                             jomo77/server-planning - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. jomo77/server-planning

ActiveProject[DevOps &amp; Deployment](/categories/devops)

jomo77/server-planning
======================

A PHP library that returns the number of servers that is required, to host a non-empty collection of virtual machines.

1.0.0(6y ago)06[1 PRs](https://github.com/jomo77/server-planning/pulls)GPL-3.0-or-laterPHPPHP &gt;=7.4CI failing

Since Dec 27Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/jomo77/server-planning)[ Packagist](https://packagist.org/packages/jomo77/server-planning)[ RSS](/packages/jomo77-server-planning/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

SERVER PLANNING
===============

[](#server-planning)

Write a library that calculates the number of servers (which have the same configuration) needed to host a specified amount of virtual machines.

Your library should return the number of servers that is required, to host a non-empty collection of virtual machines. This means you should implement the following method (UML definition): +calculate(serverType: Server, virtualMachines: VirtualMachine\[1..\*\]): int All servers have the same type. This type defines the hardware resources each server provides: CPU, RAM, HDD. Each virtual machine is defined by the virtual hardware resources it needs (on a server): CPU, RAM, HDD.

The algorithm for the virtual machine distribution should implement a 'first fit' strategy. This means there is no resource optimization or 'look back'. Virtual machines are always allocated on the current or the next server (in case of limited resources).

If a virtual machine is too 'big' for a server, it should be skipped. If the collection of virtual machines is empty, an exception should be thrown.

Example
=======

[](#example)

---

```
- Server type = {CPU: 2, RAM: 32, HDD: 100}
- Virtual Machines = [{CPU: 1, RAM: 16, HDD: 10}, {CPU: 1, RAM: 16, HDD: 10}, {CPU: 2, RAM: 32, HDD: 100}]
- Result = 2

```

---

General Requirements: - Create a composer project with PHP version 7 or higher - Free choice of dependencies, but keep it simple - Your code should be fully (unit) tested!

Requirements
============

[](#requirements)

- PHP &gt;= 7.4

Installation
============

[](#installation)

```
composer require jomo77/server-planning

composer create-project --prefer-dist --stability=dev jomo77/server-planning

```

Test
====

[](#test)

```
vendor\bin\phpunit

```

Test Windows
============

[](#test-windows)

```
c:\Projekte\server-planning\vendor\bin\phpunit.bat

```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance54

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2330d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bc29c3a6b905e6eb5034519420de6aff33d52b0f61c5c4a0a77a44a6190105df?d=identicon)[Jomo77](/maintainers/Jomo77)

---

Tags

composerpackageservervm

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jomo77-server-planning/health.svg)

```
[![Health](https://phpackages.com/badges/jomo77-server-planning/health.svg)](https://phpackages.com/packages/jomo77-server-planning)
```

###  Alternatives

[spatie/laravel-webhook-server

Send webhooks in Laravel apps

1.1k8.8M22](/packages/spatie-laravel-webhook-server)[pragmarx/health

Laravel Server &amp; App Health Monitor and Notifier

2.0k1.0M2](/packages/pragmarx-health)[felixfbecker/language-server-protocol

PHP classes for the Language Server Protocol

22476.7M6](/packages/felixfbecker-language-server-protocol)[clue/socket-raw

Simple and lightweight OOP wrapper for PHP's low-level sockets extension (ext-sockets).

35111.1M48](/packages/clue-socket-raw)[voryx/thruway

Thruway WAMP router core

6771.0M17](/packages/voryx-thruway)[php-mcp/server

PHP SDK for building Model Context Protocol (MCP) servers - Create MCP tools, resources, and prompts

828280.5k25](/packages/php-mcp-server)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
