OLS is preventing WordPress from properly communicating with Apache Tika

#1
I am trying to use Apache Tika to extract the text of PDF documents via the SearchWP Wordpress Plugin. When I do so, this error message is returned for each file:

# # There is insufficient memory for the Java Runtime Environment to continue. # Native memory allocation (mmap) failed to map 8388608 bytes for Failed to reserve memory for metaspace # An error report file with more information is saved as: # /var/www/html/wp-admin/hs_err_pid13363.log

I have attached a copy of one of those log files.

I have done many things to isolate the problem:
- HTOP on the server shows that RAM is not even nearly maxed out, which it shouldn't be given that there are only a few PDFs ranging from 7KB to 3MB.
- Tika runs fine with the same PDF files, using default java/tika settings, when run on the same server via SSH
- It works fine when run through the SearchWP plugin on a WP site installed on a NGINX or LAMP server, both with the same host (Vultr)
- It is independent of control panel, because it happens through my RunCloud-managed OLS server and an OLS site built directly via Vultr

The only remaining possibility is that OLS is interfering with this somehow. Please let me know if there is any information I can provide, or any steps I can take to diagnose/fix this. Thanks!
 

Attachments

#2
This is the other error message that sometimes comes up. Both produce error logs similar to the one attached above.

# # There is insufficient memory for the Java Runtime Environment to continue. # Native memory allocation (malloc) failed to allocate 56176 bytes for Chunk::new # An error report file with more information is saved as: # /home/runcloud-admin/webapps/seeingtheforest/wp-admin/hs_err_pid53644.log [thread 53652 also had an error] # # Can't open file to dump replay data. Error: Not enough space
 
#4
I'm not sure that that is the problem - the memory doesn't come close to maxing out. But, its quite possible I have something configured wrong. Here are the contents of my server-level and web app-level OLS config files - is there a particular line you recommend adding, removing or changing?

Server Level
Code:
#
# PLAIN TEXT CONFIGURATION FILE
#
#It not set, will use host name as serverName
serverName               
httpdWorkers              2
user                      runcloud-www
group                     runcloud-www
priority                  0
autoRestart               1
chrootPath                /
enableChroot              0
inMemBufSize              60M
swappingDir               /tmp/lsws-rc/swap
autoFix503                1
gracefulRestartTimeout    300
mime                      conf/mime.properties
showVersionNumber         0
adminEmails               root@localhost
indexFiles                index.html, index.php
disableWebAdmin           0
enableLVE                 0
autoLoadHtaccess          1

listener http {
  address                 *:80
  secure                  0
  map                     default *
}

listener https {
  address                 *:443
  secure                  1
  keyFile                 /usr/local/lsws/conf/cert/server.key
  certFile                /usr/local/lsws/conf/cert/server.crt
  certChain               1
  sslProtocol             30
  map                     default *
}

errorlog logs/error.log {
  logLevel                DEBUG
  debugLevel              0
  rollingSize             10M
  enableStderrLog         1
}

accesslog logs/access.log {
  logReferer              1
  logUserAgent            1
  logFormat               %a %l %u %t "%r" %>s %O "%{Referer}i" "%{User-Agent}i"
  logHeaders              5
  rollingSize             10M
  keepDays                30
  compressArchive         0
}

expires  {
  enableExpires           1
  expiresByType           image/*=A604800,text/css=A604800,application/x-javascript=A604800,application/javascript=A604800,font/*=A604800,application/x-font-ttf=A604800
}

tuning  {
  maxConnections          10000
  maxSSLConnections       10000
  connTimeout             300
  maxKeepAliveReq         10000
  keepAliveTimeout        5
  sndBufSize              0
  rcvBufSize              0
  maxReqURLLen            32768
  maxReqHeaderSize        65536
  maxReqBodySize          2047M
  maxDynRespHeaderSize    32768
  maxDynRespSize          2047M
  maxCachedFileSize       4096
  totalInMemCacheSize     20M
  maxMMapFileSize         256K
  totalMMapCacheSize      40M
  useSendfile             1
  fileETag                28
  enableGzipCompress      1
  compressibleTypes       default
  enableDynGzipCompress   1
  gzipCompressLevel       6
  gzipAutoUpdateStatic    1
  gzipStaticCompressLevel 6
  brStaticCompressLevel   6
  gzipMaxFileSize         10M
  gzipMinFileSize         300

  quicEnable              1
  quicShmDir              /dev/shm
}

fileAccessControl  {
  followSymbolLink        1
  checkSymbolLink         0
  requiredPermissionMask  000
  restrictedPermissionMask 000
}

perClientConnLimit  {
  staticReqPerSec         0
  dynReqPerSec            0
  outBandwidth            0
  inBandwidth             0
  softLimit               10000
  hardLimit               10000
  gracePeriod             15
  banPeriod               300
}

CGIRLimit  {
  maxCGIInstances         20
  minUID                  11
  minGID                  10
  priority                0
  CPUSoftLimit            10
  CPUHardLimit            50
  memSoftLimit            1460M
  memHardLimit            1470M
  procSoftLimit           400
  procHardLimit           450
}

accessDenyDir  {
  dir                     /
  dir                     /etc/*
  dir                     /dev/*
  dir                     conf/*
  dir                     admin/conf/*
}

accessControl  {
  allow                   ALL
}

module cache {
  ls_enabled              1
  checkPrivateCache       1
  checkPublicCache        1
  maxCacheObjSize         10000000
  maxStaleAge             200
  qsCache                 1
  reqCookieCache          1
  respCookieCache         1
  ignoreReqCacheCtrl      1
  ignoreRespCacheCtrl     0
  enableCache             0
  expireInSeconds         3600
  enablePrivateCache      0
  privateExpireInSeconds  3600
}

include /etc/lsws-rc/default.d/*.conf
include /etc/lsws-rc/conf.d/*.conf
Web App
Code:
# Editing this file manually might change litespeed behavior,
# Make sure you know what are you doing
index  {
  useServer               0
  indexFiles index.php,index.html
}

scripthandler  {
  add                     lsapi:seeingtheforest php
}

extprocessor seeingtheforest {
  type                    lsapi
  address                 UDS://tmp/lshttpd/seeingtheforest.sock
  maxConns                35
  env                     PHP_LSAPI_MAX_REQUESTS=5000
  env                     PHP_LSAPI_CHILDREN=35
  initTimeout             60
  retryTimeout            0
  persistConn             1
  respBuffer              0
  autoStart               2
  backlog                 100
  instances               1
  extUser                 runcloud
  extGroup                runcloud
  runOnStartUp            3
  priority                0
  memSoftLimit            2047M
  memHardLimit            2047M
  procSoftLimit           400
  procHardLimit           500
  #do not edit line below, it will break runcloud system, use web app settings instead
  path                    /usr/local/lsws/lsphp74/bin/lsphp
}

expires {
  enableExpires           1
  expiresByType           image/*=A43200,text/css=A43200,application/x-javascript=A43200,application/javascript=A43200,font/*=A43200,application/x-font-ttf=A43200
}

rewrite  {
  enable                  1
  autoLoadHtaccess        1
}
 

Pong

Administrator
#5
Try to change the following
memSoftLimit 2047M
memHardLimit 2047M

to 16G or even higher like 100G to see how it goes. If still issue, you can log a ticket by sending email to support@litespeedtech.com with your server 's full ssh access and steps to reproduce the issue, we can take further look.
 
#6
@Pong Very interesting, I changed to 2047G and it worked. That seems silly though. I then tried 2,3 and 4G and it only worked on 4G.

What might this be due to? Is there any harm in leaving it at 4G? My server only has 2G of RAM.

And, again, these are miniscule files - Ive tried it with a single 30kb file and it doesnt work unless at 4G.

Thanks for your help!
 
Top