TP3.2测试问题

浏览:587 发布日期:2014/05/11 分类:心情闲聊
用ab压测tp3.2,控制器只是输出一个json字符串,并发100居然达到了9秒!!这效率有点太低了吧!
用的RestController.namespace Home\Controller;


use Think\Controller\RestController;

class UserController extends RestController{
    protected $allowMethod    = array('get','post','put'); // REST允许的请求类型列表
    protected $allowType      = array('html','xml','json'); // REST允许请求的资源类型列表
    Public function read_get_html(){
        $data = array("status"=>1,"info"=>"ok");
        $this->response($data,'json');
        // 输出id为1的Info的html页面
    }
    Public function read_get_xml(){

        // 输出id为1的Info的XML数据
    }
    Public function read_xml(){
        // 输出id为1的Info的XML数据
    }
    Public function read_json(){
        // 输出id为1的Info的json数据
    }

}
最佳答案
评论( 相关
后面还有条评论,点击查看>>