zoukankan      html  css  js  c++  java
  • Linux学习81 互联网架构-LAMP全面入门讲解

    一、回顾:http协议和httpd的配置

      1、http协议

        a、url

        b、request and response

          request:

          <method><URL><VERSION>

          <HEADERS>

          <entity-body>

          response:

          <version><status><reason-phrase>

          <HEADERS>

          

          <entity-body>

        c、HEADERS:通用首部,请求首部,响应首部,实体首部,扩展首部

          Host、Connection、Server、Via、...

      2、httpd的配置

        a、curl、user/group、https、压缩传输

      3、httpd的压力测试工具

        a、压测:benchmark

        b、ab,webbench,http_load,seige

        c、jmeter,loadrunner

        d、tcpcopy:网易,复制生产环境中的真实请求,并将之保存下来

        e、ab [OPTIONS] URL

          (1)、-n:总请求数

          (2)、-c:模拟的并行数

          (3)、-k:以持久连接模式测试

          (4)、现在我们来模拟十万个请求,10个并发数

    [root@www ~]# ab -n 100000 -c 10 http://192.168.10.13/
    This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
    Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
    Licensed to The Apache Software Foundation, http://www.apache.org/
    
    Benchmarking 192.168.10.13 (be patient)
    Completed 10000 requests
    Completed 20000 requests
    Completed 30000 requests
    Completed 40000 requests
    Completed 50000 requests
    Completed 60000 requests
    Completed 70000 requests
    Completed 80000 requests
    Completed 90000 requests
    Completed 100000 requests
    Finished 100000 requests
    
    
    Server Software:        Apache/2.4.6 #程序版本号
    Server Hostname:        192.168.10.13 #服务器主机名
    Server Port:            80 #端口
    
    Document Path:          /
    Document Length:        16 bytes
    
    Concurrency Level:      10 #并发级别
    Time taken for tests:   20.855 seconds #总共响应时长
    Complete requests:      100000 #完成请求的个数
    Failed requests:        0
    Write errors:           0
    Total transferred:      31200000 bytes #总的传输数据大小
    HTML transferred:       1600000 bytes
    Requests per second:    4795.06 [#/sec] (mean) #服务器每秒处理的请求
    Time per request:       2.085 [ms] (mean) #每一个并发处理所消耗的时间
    Time per request:       0.209 [ms] (mean, across all concurrent requests)#每单个请求所经由的时长,最重要的就是看这个
    Transfer rate:          1461.00 [Kbytes/sec] received #传输速率
    
    Connection Times (ms)
                  min  mean[+/-sd] median   max
    Connect:        0    0   0.4      0      22
    Processing:     0    2   2.3      2      56
    Waiting:        0    2   2.1      1      52
    Total:          0    2   2.3      2      56
    
    Percentage of the requests served within a certain time (ms)
      50%      2 #完成百分之50消耗的时间,下面依次类推
      66%      2
      75%      2
      80%      2
      90%      3
      95%      4
      98%      6
      99%     10
     100%     56 (longest request)

    二、httpd-2.4的新特性

      1、特性

        

       2、新模块

        

       3、练习题

     

     三、LAMP

      1、概述

        a、CGI(Common Gateway Interface):通用网关接口,客户端向服务器端请求资源时服务器端将相应的资源在程序运行后将结果返回给客户端

          

      2、概念

        a、a:apache(httpd)

        b、m:mysql,mariadb

        c、p:php,perl,python

      3、WEB资源类型

        a、静态资源:原始形式与响应内容一致

        b、动态资源:原始形式通常为程序文件,需要在服务器执行之后,将执行结果返回给客户端

        c、客户端技术:javascript

        d、服务器端技术:php,jsp

      4、CGI:Common Gateway Interface

        a、可以让一个客户端,从网页浏览器向执行在网络服务器上的程序传输数据;CGI描述了客户端和服务器程序之间传输的一种标准

        b、程序=指令+数据

          (1)、数据模型:

            1)、层次模型

            2)、网状模型

            3)、关系模型:表(行+列)

          (2)、关系模型:IngreSQL,Oracle,Sybase,Infomix,DB2,SQL Server,MySQL,PostgreSQL,MariaDB

      5、LAMP架构

        

  • 相关阅读:
    ARM9嵌入式学习日志--20170828
    技术积累
    做产品还是做技术?
    python学习之一
    他山之石——面试非技术问题整理(持续更新中)
    他山之石——面试技术问题整理(持续更新中)
    .bss .text和.data简介
    linux学习——大话linux网络
    实用的技术网站
    linux学习——centos minimal安装vim
  • 原文地址:https://www.cnblogs.com/Presley-lpc/p/12914906.html
Copyright © 2011-2022 走看看