More Memcache, Squid, Benchmarking, More HTML 5




CS174

Chris Pollett

May 4, 2016

Outline

Scaling a Web-site

Example Web-site Architecture

Organization of a website show squids, http servers, memcached server, databases.

Demo of connecting to memcached as a human - get

Some Remarks on Memcached

Using memcached in PHP

Example Memcache Test

<html>
<head><title>Memcache Test</title></head>
<body>
<h1>Test</h1>
<?php
  $memcache = new Memcache();
  $memcache->addServer("localhost", 11211, true, 1, 1, 5);
  $memcache->set("bob", "value", null, 60);
  echo "<p>".$memcache->get("bob")."</p>";
?>
</body>
</html>

Squid

Setting up squid

Testing Squid

Configuring Squid as a Reverse Proxy

Load Balancing Machines

Benchmarking

Let's Experiment

Pick two of the pages of your Hw3 (not Hw4) solution. For each page, get a transcript of doing 1000 requests to that page using Apache Bench. Try three different settings for the concurrency 1, 10, 100.

Post what you observed to the May 4 Discussion Thread.

Multimedia and HTML 5

Mobile HTML 5

A Template HTML 5 Document with jQuery Mobile

<!DOCTYPE html>
<html> 
    <head> 
    <title>Hello HTML 5</title> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" /> 
    <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script> 
    <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script></head> 
<body> 

<div data-role="page">

    <div data-role="header">
        <h1>My First HTML APP!</h1>
    </div><!-- /header -->

    <div data-role="content">    
        <p>This is an HTML 5 app.</p>        
    </div><!-- /content -->

</div><!-- /page -->

</body>
</html>

Hello HTML 5 app.

The Head of a Document

Remarks on the Body of our Example

Where to Find Examples