Coder Social home page Coder Social logo

siddhant-vij / word-frequency-server Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.16 MB

HTTP server that counts the frequency of a given word in the text file.

License: MIT License

Go 100.00%
concurrent-programming frequency-count golang http-server

word-frequency-server's Introduction

Word Frequency Server

This project aims to build a simple Go-based HTTP server that counts the frequency of a given word in the downloaded text file from Gutenberg project.

This server is built as a part of the Load Testing Utility, which is used to test the performance of this server in terms of Latency and Throughput w.r.t the number of server threads used to process the frequency count requests.


Table of Contents

  1. Server Implementation
  2. Concurrent Design
  3. Notes
  4. Contributing
  5. License

Server Implementation

  • The server is implemented using Go's Networking API (no framework is used).
  • It listens for HTTP GET requests and processes them to return the frequency of a specified word in resources/war_and_peace.txt.

Concurrent Design

  • The server is implemented using numServerThreads goroutines to process the requests concurrently - as an input given by the Load Testing Utility for server threads.
  • The server waits for all the goroutines to finish their execution and then, returns the frequency of the word in the text file.
  • The server implements the Producer-Consumer design pattern with a channel to handle the tasks.
  • Basic throttling is implemented to check for and avoid channel overflow, maintaining a high throughput.
  • This design is used to achieve the Load Testing Utility's requirement to test the server's performance.

Notes

  • Ensure that this server is running before starting the load testing utility.
  • The server and load testing utility are designed for educational purposes to demonstrate the effects of multithreading on performance.

Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch:
    git checkout -b feature/AmazingFeature
  3. Commit your Changes:
    git commit -m 'Add some AmazingFeature'
  4. Push to the Branch:
    git push origin feature/AmazingFeature
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

word-frequency-server's People

Contributors

siddhant-vij avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.