文档预览服务

FQA

性能指标

  • 文件转换时,对CPU使用率较高,增加CPU核数,可以提高文件的转换速度。
  • 一台4CPU 8G内存服务器大约可以支持到200个文件同时并发转换。
  • 当并发量要求较高时,建意文档预览服务采用集群部署。
  • 文档转换速度与文档大小、网速、服务器内存、CPU都有关系,当转换速度较慢时,建意提高网速 扩大服务器内存、CPU核数
  • 5M的文件在8核32G内存服务器转换用时大概需要5s
  • 20M的文件在8核32G内存服务器转换用时大概需要50s

字体说明

当转换后如遇文档内容乱码,一般仅需要在文档预览服务器安装该文档使用的字体即可。

转换服务器出现很多WPS进程

WPS Office 2019 11.1.0.8214这个版本会出现在转换服务器上存在很多WPS进程,进而导致转换很慢。因此我们推荐使用WPS Office 2016,不推荐使用WPS office2019。

WindowServer2016启动文档预览服务失败

问题1:windows server2016,文档转换服务启动不了,黑窗里一直在发送日志警告,无法启动成功

解决方案:start.init文件中增加如下内容

--exec
-Dorg.eclipse.jetty.annotations.AnnotationParser.LEVEL=OFF

startup.bat文件 jetty11使用的jdk17,检查JAVA_HOME目录

 @echo off
TITLE DOC-TRANSFER Server
REM 进入当前批处理文件所在的目录
cd /d %~dp0

rem 设置转换服务使用的JDK
rem ---------------------
set JAVA_HOME=jdk17\
set PATH=%JAVA_HOME%\bin;%PATH%

rem chcp 65001 [utf-8] -Dfile.encoding=utf-8
rem chcp 936 [gbk]
set HBASE_OPTS="-XX:+UseConcMarkSweepGC" "-Djava.net.preferIPv4Stack=true"
set HBASE_OPTS="-Djava.net.preferIPv4Stack=true"
java -Xmx1g -Xms1g -Xmn1g -Xss180k -XX:MaxTenuringThreshold=0  -Duser.timezone=GMT+08 -Duser.language=zh -Duser.region=CN -Dsun.jnu.encoding=utf-8 -XX:+HeapDumpOnOutOfMemoryError -Dorg.eclipse.jetty.annotations.maxWait=320 -jar start.jar
cmd /

问题2:启动报错

WARN  : Forking second JVM due to forking module(s): []. Use --dry-run to generate the command line to avoid forking.
2024-11-04 13:33:26.319:WARN :oejs.HomeBaseWarning:main: This instance of Jetty is not running from a separate {jetty.base} directory, this is not recommended.  See documentation at https://www.eclipse.org/jetty/documentation/current/startup.html
2024-11-04 13:33:26.395:INFO :oejs.Server:main: jetty-11.0.15; built: 2023-04-11T18:37:53.775Z; git: 5bc5e562c8d05c5862505aebe5cf83a61bdbcb96; jvm 17.0.8+9-LTS-211
2024-11-04 13:33:26.567:WARN :oejx.XmlConfiguration:main: Unable to execute XmlConfiguration
java.io.IOException: Failed to bind to /172.20.0.145:8099
        at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:344)
        at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:304)
        at org.eclipse.jetty.server.Server.lambda$doStart$0(Server.java:402)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
        at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
        at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
        at org.eclipse.jetty.server.Server.doStart(Server.java:398)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
        at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1875)
Caused by:
java.net.BindException: Cannot assign requested address: bind
        at java.base/sun.nio.ch.Net.bind0(Native Method)
        at java.base/sun.nio.ch.Net.bind(Net.java:555)
        at java.base/sun.nio.ch.ServerSocketChannelImpl.netBind(ServerSocketChannelImpl.java:337)
        at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:294)
        at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:339)
        at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:304)
        at org.eclipse.jetty.server.Server.lambda$doStart$0(Server.java:402)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
        at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
        at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
        at org.eclipse.jetty.server.Server.doStart(Server.java:398)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
        at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1875)
Exception in thread "main" java.io.IOException: Failed to bind to /172.20.0.145:8099
        at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:344)
        at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:304)
        at org.eclipse.jetty.server.Server.lambda$doStart$0(Server.java:402)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
        at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
        at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
        at org.eclipse.jetty.server.Server.doStart(Server.java:398)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
        at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1875)
Caused by: java.net.BindException: Cannot assign requested address: bind
        at java.base/sun.nio.ch.Net.bind0(Native Method)
        at java.base/sun.nio.ch.Net.bind(Net.java:555)
        at java.base/sun.nio.ch.ServerSocketChannelImpl.netBind(ServerSocketChannelImpl.java:337)
        at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:294)
        at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:339)
        ... 15 more
E:\doctransfer20241031\doc-transfer\jetty-home-11.0.15>

解决方案:

检查stat.init文件中IP和端口配置,检查端口是否被占用:netstat -ano|findstr 8099

正常启动:

有Started Server输出日志,则说明启动成功。



Seven
 010-62962343-690
 liujx@actionsoft.com.cn
感谢您对该文档的关注!如果您对当前页面内容有疑问或好的建议,请与我联系。如果您需要解答相关技术问题请登录AWS客户成功社区