retoor 2ee1ff809c fix: rename logmsg to log_event and add structured logging with host info in IRC server
- Renamed `logmsg` function to `log_event` for consistency with new logging format
- Added ISO 8601 timestamp buffer `timebuf` and replaced `tbuf` with it in log output
- Updated join/leave log messages to include client host and structured format (e.g., "user joined: <nick> (<host>) joined channel <name>")
- Moved leave log call inside the member removal loop to ensure it fires only on actual removal
2025-05-06 13:52:54 +00:00

IRC Server and Load Testing Tool

Overview

This project consists of an IRC server implementation and a load testing tool designed to simulate multiple IRC clients. The server utilizes the epoll mechanism for efficient handling of client connections and commands, while the load testing tool measures the performance of the server under heavy load.

Features

  • IRC Server: Implements basic IRC functionalities including user registration, channel creation, message broadcasting, and more.
  • Load Testing Tool: Simulates multiple IRC clients connecting to the server, joining channels, and sending messages to evaluate server performance.
  • Concurrency: Utilizes pthreads for handling multiple clients simultaneously.
  • Performance Metrics: Measures total messages sent, bytes sent, and received during the load test.

Requirements

  • C Compiler (gcc)
  • POSIX Threads Library
  • Standard C Libraries

Installation

  1. Clone the repository:
    git clone <repository-url>
    cd <repository-directory>
    
  2. Compile the server and load testing tool:
    make
    

Usage

Running the IRC Server

To start the IRC server, run the following command:

./irc_server --log

The server will listen on port 6667 by default and will log messages to the terminal when the --log flag is used.

Running the Load Testing Tool

To execute the load testing tool, run:

./load_test

This will simulate multiple clients connecting to the IRC server and sending messages.

Performance Metrics

After running the load test, the following metrics will be displayed:

  • Total time taken for the test
  • Total messages sent
  • Messages per second
  • Total bytes sent and received
  • Send and receive rates in MB/s
S
Description
High performance IRC server that can handle 10.000+ concurrent users. Could be used for pubsub. Considered it as a backend for Snek but Snek is already performing well.
Readme
60 KiB
Languages
C 99.4%
Makefile 0.6%