热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

SoapServer-性能问题(可能与SQLite相关)-SoapServer-performanceissue(mightbeSQLiterelated)

YesterdayIvepostedquestionaboutSQLiteperformanceissues(TerribleperformanceinZendDbPDO

Yesterday I've posted question about SQLite performance issues ( Terrible performance in Zend Db PDO_sqlite insert and update queries ). After several tests It seems like the problem occurs only when methods are called through SoapServer (tried both native PHP SoapServer and Zend_Soap_Server classes).

昨天我发布了关于SQLite性能问题的问题(Zend Db PDO_sqlite插入和更新查询中的可怕性能)。经过多次测试似乎只有在通过SoapServer调用方法时才会出现问题(尝试了本机PHP SoapServer和Zend_Soap_Server类)。

Test case - calling 10 methods which use SQLite DB INSERT and UPDATE DB operations.

测试用例 - 调用10个使用SQLite DB INSERT和UPDATE DB操作的方法。

Here are several cases of how it works:

以下是几种工作原理:

1.Through the controller - without using Soap server. localhost:~0.3s, remote server:~0.3s

1.通过控制器 - 不使用Soap服务器。 localhost:~0.3s,远程服务器:~0.3s

2.Through the Soap server. 1st call. localhost:~1-2s, remote server:~7s!

2.通过Soap服务器。第一个电话。 localhost:~1-2s,远程服务器:~7s!

3.Through the Soap server. Several calls. localhost:~1-10s, remote server:~7s

3.通过Soap服务器。几个电话。 localhost:~1-10s,远程服务器:~7s

3rd case doesn't concern me that much, probably might be the local server performance issue. Important thing is that it works stable on remote server.

第三种情况并不关心我,可能是本地服务器性能问题。重要的是它在远程服务器上运行稳定。

On the other hand, 7 seconds for simple 10 method calls is increadibly long. Obviously - part of this 7 seconds is client-server communication, as case 1 omits that, but i don't think It should be that slow!

另一方面,简单的10个方法调用的7秒是可增长的。显然 - 这7秒的一部分是客户端 - 服务器通信,如案例1省略的那样,但我不认为它应该那么慢!

For debugging I'm logging everything, and what seems to happen is that the same SQLite methods called in case 1, take 0.00x-0.02s, here last for ~0.15-0.45s.

对于调试我正在记录所有内容,似乎发生的情况是在案例1中调用的相同SQLite方法,取0.00x-0.02s,此处最后为~0.15-0.45s。

What might be the issue? Is it normal thing that it slows down so drasticly when using SOAP? (It's my first soap server project).

可能是什么问题?使用SOAP时它是如此急剧减速是否正常? (这是我的第一个肥皂服务器项目)。

EDIT: another important log fact I've found:

编辑:我发现的另一个重要的日志事实:

Information -2012-04-26 13:08:07.782679 Class: SoapController. Method: SoapController::hadleWSDL. Line: 18.

信息-2012-04-26 13:08:07.782679类:SoapController。方法:SoapController :: hadleWSDL。行:18。

Information-2012-04-26 13:08:08.318641 * SYSTEM START UP *

信息-2012-04-26 13:08:08.318641 *系统启动*

So that's basicly time between 2 methods being called. Over 0.5s for client-server communication with a little amount of data seems a lot to me. Here's the code for handleWSDL action:

所以这就是调用两种方法之间的基本时间。使用少量数据进行客户端 - 服务器通信超过0.5秒对我来说似乎很重要。这是handleWSDL操作的代码:

$optiOns= array(
    'encoding' => 'UTF-8',
    'cache_wsdl' => WSDL_CACHE_BOTH,
    'uri' =>$this->_WSDL_URI
);  
$soap = new Zend_Soap_Server(null, $options); 
$soap->setClass('SoapServerFunction');
$soap->setObject(new SoapServerFunction());
$soap->handle();

The application is really simple - SOAP method takes 1 parameter, and basing on it 1 cached object is created, data is being processed, and part of data is returned in XML format.

应用程序非常简单 - SOAP方法接受1个参数,并在此基础上创建1个缓存对象,正在处理数据,并以XML格式返回部分数据。

Thank you in advance for any suggestions what I can do to either make it faster or how to track what's the real reason of slowing down.

提前感谢您提出的任何建议,我可以做些什么来加快速度,或者如何跟踪减速的真正原因。

Best regards!

最好的祝福!

1 个解决方案

#1


0  

Do you use a FQDN for the server's address? In that case it might actually be DNS-related. You might also want to try everything on a real system and not on a virtual host, as you will not have much control over what the physical system is actually doing.

您是否使用FQDN作为服务器的地址?在这种情况下,它实际上可能与DNS相关。您可能还想尝试在真实系统上而不是虚拟主机上的所有内容,因为您无法控制物理系统实际执行的操作。

Secondly, I would recommend installing xdebug and use kcachegrind or wincachegrind, which will give you a much more detailled view of what your system is doing.

其次,我建议安装xdebug并使用kcachegrind或wincachegrind,这将为您提供更详细的系统视图。

Thirdly, you may log slow queries by utilizing PostgreSQLs pg_stat_statements().

第三,您可以使用PostgreSQLs pg_stat_statements()记录慢查询。


推荐阅读
  • 微软评估和规划(MAP)的工具包介绍及应用实验手册
    本文介绍了微软评估和规划(MAP)的工具包,该工具包是一个无代理工具,旨在简化和精简通过网络范围内的自动发现和评估IT基础设施在多个方案规划进程。工具包支持库存和使用用于SQL Server和Windows Server迁移评估,以及评估服务器的信息最广泛使用微软的技术。此外,工具包还提供了服务器虚拟化方案,以帮助识别未被充分利用的资源和硬件需要成功巩固服务器使用微软的Hyper - V技术规格。 ... [详细]
  • 利用Visual Basic开发SAP接口程序初探的方法与原理
    本文介绍了利用Visual Basic开发SAP接口程序的方法与原理,以及SAP R/3系统的特点和二次开发平台ABAP的使用。通过程序接口自动读取SAP R/3的数据表或视图,在外部进行处理和利用水晶报表等工具生成符合中国人习惯的报表样式。具体介绍了RFC调用的原理和模型,并强调本文主要不讨论SAP R/3函数的开发,而是针对使用SAP的公司的非ABAP开发人员提供了初步的接口程序开发指导。 ... [详细]
  • 阿,里,云,物,联网,net,core,客户端,czgl,aliiotclient, ... [详细]
  • Java在运行已编译完成的类时,是通过java虚拟机来装载和执行的,java虚拟机通过操作系统命令JAVA_HOMEbinjava–option来启 ... [详细]
  • 本文介绍了在Linux下安装和配置Kafka的方法,包括安装JDK、下载和解压Kafka、配置Kafka的参数,以及配置Kafka的日志目录、服务器IP和日志存放路径等。同时还提供了单机配置部署的方法和zookeeper地址和端口的配置。通过实操成功的案例,帮助读者快速完成Kafka的安装和配置。 ... [详细]
  • PHP设置MySQL字符集的方法及使用mysqli_set_charset函数
    本文介绍了PHP设置MySQL字符集的方法,详细介绍了使用mysqli_set_charset函数来规定与数据库服务器进行数据传送时要使用的字符集。通过示例代码演示了如何设置默认客户端字符集。 ... [详细]
  • 本文介绍了如何使用php限制数据库插入的条数并显示每次插入数据库之间的数据数目,以及避免重复提交的方法。同时还介绍了如何限制某一个数据库用户的并发连接数,以及设置数据库的连接数和连接超时时间的方法。最后提供了一些关于浏览器在线用户数和数据库连接数量比例的参考值。 ... [详细]
  • Centos7.6安装Gitlab教程及注意事项
    本文介绍了在Centos7.6系统下安装Gitlab的详细教程,并提供了一些注意事项。教程包括查看系统版本、安装必要的软件包、配置防火墙等步骤。同时,还强调了使用阿里云服务器时的特殊配置需求,以及建议至少4GB的可用RAM来运行GitLab。 ... [详细]
  • 如何使用Java获取服务器硬件信息和磁盘负载率
    本文介绍了使用Java编程语言获取服务器硬件信息和磁盘负载率的方法。首先在远程服务器上搭建一个支持服务端语言的HTTP服务,并获取服务器的磁盘信息,并将结果输出。然后在本地使用JS编写一个AJAX脚本,远程请求服务端的程序,得到结果并展示给用户。其中还介绍了如何提取硬盘序列号的方法。 ... [详细]
  • 本文介绍了如何找到并终止在8080端口上运行的进程的方法,通过使用终端命令lsof -i :8080可以获取在该端口上运行的所有进程的输出,并使用kill命令终止指定进程的运行。 ... [详细]
  • Linux如何安装Mongodb的详细步骤和注意事项
    本文介绍了Linux如何安装Mongodb的详细步骤和注意事项,同时介绍了Mongodb的特点和优势。Mongodb是一个开源的数据库,适用于各种规模的企业和各类应用程序。它具有灵活的数据模式和高性能的数据读写操作,能够提高企业的敏捷性和可扩展性。文章还提供了Mongodb的下载安装包地址。 ... [详细]
  • ubuntu用sqoop将数据从hive导入mysql时,命令: ... [详细]
  • phpcomposer 那个中文镜像是不是凉了 ... [详细]
  • MySQL语句大全:创建、授权、查询、修改等【MySQL】的使用方法详解
    本文详细介绍了MySQL语句的使用方法,包括创建用户、授权、查询、修改等操作。通过连接MySQL数据库,可以使用命令创建用户,并指定该用户在哪个主机上可以登录。同时,还可以设置用户的登录密码。通过本文,您可以全面了解MySQL语句的使用方法。 ... [详细]
  • 如何在php文件中添加图片?
    本文详细解答了如何在php文件中添加图片的问题,包括插入图片的代码、使用PHPword在载入模板中插入图片的方法,以及使用gd库生成不同类型的图像文件的示例。同时还介绍了如何生成一个正方形文件的步骤。希望对大家有所帮助。 ... [详细]
author-avatar
淡若清芬_920
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有