# 验证服务启动成功如果开启了Http支持可以直接访问 ``` http://localhost:8081 ``` 如果出现以下界面就代表服务启动成功了。 ![](https://box.kancloud.cn/04189f55787af8d13213f51ffee95aba_724x226.png) 另外你也可以访问控制器方法 ``` http://localhost:8081/TestController/test ``` 如果是Tcp连接你将需要创建一个socket连接来测试,我们提供了一个测试文件start\_swoole\_client.php。 ```php $worker_num = 100; $total_num = 100000; $GLOBALS['package_length_type'] = 'N'; $GLOBALS['package_length_type_len'] = 4; $GLOBALS['package_length_offset'] = 0; $ips = ['127.0.0.1', '192.168.21.10']; $GLOBALS['total_num'] = $total_num; $GLOBALS['worker_num'] = $worker_num; $GLOBALS['count'] = 0; $GLOBALS['count_page'] = 0; $GLOBALS['test_count'] = 0; ``` 通过修改上面的配置,和你的服务器配置保持一致。其中ips是服务器列表,如果你只是测试单机那么只需要填写\['127.0.0.1'\]即可。 ```php function connect($cli) { $cli->send(encode(json_pack('TestController', 'bind_uid', $cli->i))); swoole_timer_after(1000, function () use ($cli) { $GLOBALS['start_time'] = getMillisecond(); for ($i = 0; $i < $cli->total_num; $i++) { $cli->send(encode(json_pack('TestController', 'efficiency_test', $GLOBALS['test_count']))); $GLOBALS['test_count']++; } }); } ``` 这里的efficiency\_test为测试集群性能,如果单机可以改为efficiency\_test2。