Giter Site home page Giter Site logo

zotflix's Introduction

CS 122B: Fabflix

  • General

    • Team#: 82

    • Names: Jenny Diep

    • Project 2 LATE Video Demo Link: https://youtu.be/U0qVCBLomhs

    • Project 5 Video Demo Link: https://youtu.be/gSopbQXfAmE

    • Instruction of deployment:

      If you do not have USER mytestuser setup in MySQL, follow the below steps to create it:
      • login to mysql as a root user

        local> mysql -u root -p
        
      • create a test user and grant privileges:

        mysql> CREATE USER 'mytestuser'@'localhost' IDENTIFIED BY 'mypassword';
        mysql> GRANT ALL PRIVILEGES ON * . * TO 'mytestuser'@'localhost';
        mysql> quit;
        
      • prepare the database moviedb

        mysql -u mytestuser-p < create_table.sql
        

      To run this example on local machine:

        1. Clone this repository 
        2. Open IntelliJ -> Import Project -> Choose the project you just cloned (The root path must contain the pom.xml!) -> Choose Import project from external model -> choose Maven -> Click on Finish -> The IntelliJ will load automatically
        3. For "Root Directory", right click "cs122b-spring20-project1-api-example" -> Mark Directory as -> sources root
        4. In `WebContent/META-INF/context.xml`, make sure the mysql username is `mytestuser` and password is `mypassword`.
        5. Also make sure you have the `moviedb` database.
        6. To run the example, follow the instructions in [canvas](https://canvas.eee.uci.edu/courses/26486/pages/intellij-idea-tomcat-configuration)
      
  • Connection Pooling

    • Include the filename/path of all code/configuration files in GitHub of using JDBC Connection Pooling.

      context.xml

      DashBoardServlet

      LoginServlet

      ItemsServlet

      PaymentServlet

      AdvancedSearchServlet

      SingleMovieServlet

      SingleStarServlet

      AddMovieServlet

      GenreServlet

      SearchServlet

      MetaDataServlet

      StarsServlet

    • Explain how Connection Pooling is utilized in the Fabflix code.

      maxTotal="100" maxIdle="30" maxWaitMillis="10000"
      

      maxTotal represents the max amount of connections to the db which is 100 connects, maxIdle represents the minimum number of connections and maxWaitMillis represents the amount of time waiting on the connection before timing out.

      Since there are many calls to the db in Fabflix connection pooling is a way to make calls from and to the database more efficient. Instead of establishing new connections for example in each search call, instead it will use a connection that was already established in the pool of connections.

    • Explain how Connection Pooling works with two backend SQL.

      Connection pooling with two backend databases works similar to single database where instead of establishing new connections it chooses existing connections, however the pools are shared between two databases which speeds up queries since there can be multiple queries at once instead of waiting for one query to finish.

  • Master/Slave

  • JMeter TS/TJ Time Logs

    • NOTE: I did not finish xml implementation so I am using my own query_load.txt file with movies that are only in the original database

    • another note: single aws instance on 8080 is the same as the load balancer instance.

    • Instructions of how to use the log_processing.* script to process the JMeter logs.

      log_processing.py prints out the average TS and TJ time

      Go to set folder ex: .../log/1

      Run:

      python3 ../log_processing.py       
      
  • JMeter TS/TJ Time Measurement Report

Single-instance Version Test Plan Graph Results Screenshot Average Query Time(ms) Average Search Servlet Time(ms) Average JDBC Time(ms) Analysis
Case 1: HTTP/1 thread 1 231 147.11685 146.91967 Having only one user means there is no wait time for other users to finish their search query thus explains its speed.
Case 2: HTTP/10 threads 2 1649 1481.37576 1481.21719 naturally with only one databases, when adding more users the queries get slower speeds since they have to wait for each query to finish.
Case 3: HTTPS/10 threads 3 1794 1482.13113 1481.89844 I hypothesized that https would be slower since it takes more time due to encryption that https has which seems to be true.
Case 4: HTTP/10 threads/No connection pooling 4 1572 1426.65872 1426.47031 I hypothesized that no connection pooling would have a higher average however I assume connection pooling isn't much faster in single system since you still have to wait for a whole query to finish and that establishing new connections does not cost as much.
Scaled Version Test Plan Graph Results Screenshot Average Query Time(ms) Average Search Servlet Time(ms) Average JDBC Time(ms) Analysis
Case 1: HTTP/1 thread 5 230 143.42437 143.17355 As expected to have the same time as no single instance since if there is only one user tied to one session there are not too many calls to overload the database
Case 2: HTTP/10 threads 6 794 696.48106 696.29226 Was expected to be much quicker but was not expected it to be 3x as fast. The logic behind the scaled version being faster is that reads are much faster since calls to the database are offloaded onto the other server.
Case 3: HTTP/10 threads/No connection pooling 928 717.43103 717.27264 Here connection pooling is shown as slower which I hypothesized because without connection pooling the times to create new connections and destroy connections added up for extra time.

substring matching

title: any title that starts with "x"
director: has "x" in it
star: has "x" in it

zotflix's People

Contributors

jennydiep avatar yicong-huang avatar sadeemsaleh 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.