Neu Massiver jtl-shop-cron aufruf

lord_icon

Gut bekanntes Mitglied
21. Juli 2007
199
8
"Ihre Datenbank entspricht dem aktuellen Systemstand (Version 5.4.0). "

Moin moin...

im Folge eine Serverprüfung haben wir massiven Aufruf vom jtl-shop-cron erhalten.
Nach Stundenlander suche würde ich nun folgenden (dummen) ablauf VERMUTEN

Code:
Besucher/Bot ruft Shopseite auf
        ↓
JTL-Shop startet intern den Cron-Starter
        ↓
includes/src/Cron/Starter/Curl.php
        ↓
Server ruft sich selbst per curl auf
        ↓
POST /includes/cron_inc.php
User-Agent: jtl-shop-cron
IP: ***.***.***.***
        ↓
cron_inc.php lädt den Shop und prüft Cron/Queue

Sprich: JEDER Aufruf der Website läd den Cron.

Folgende Auszüge was 1h Logauszug wiederspiegelt:
Code:
awk '$4 >= "[21/May/2026:08:40" {
    split($1, ip, ".")
    $1 = "***.***.***." ip[4]
    print $1, $7, $9, $10, $12
}' /var/www/clients/client3/web20/log/access.log \
| sort | uniq -c | sort -nr | head -80


    319 ***.***.***.21 /includes/cron_inc.php 200 4353 "jtl-shop-cron"
     10 ***.***.***.151 /dbeS/mytest.php 200 3927 "JTL-Wawi/1.11.9.0
     10 ***.***.***.151 /dbeS/GetKunden_xml.php 200 473 "JTL-Wawi/1.11.9.0
     10 ***.***.***.151 /dbeS/GetData_xml.php 200 473 "JTL-Wawi/1.11.9.0
     10 ***.***.***.151 /dbeS/GetBestellungen_xml.php 200 473 "JTL-Wawi/1.11.9.0
      9 ***.***.***.151 /dbeS/GetZahlungen_xml.php 200 473 "JTL-Wawi/1.11.9.0
      8 ***.***.***.37 /_updateconsent 200 4408 "Mozilla/5.0
      8 ***.***.***.151 /dbeS/lastjobs.php 200 473 "JTL-Wawi/1.11.9.0
      7 ***.***.***.198 /admin/io 200 562 "Mozilla/5.0
      7 ***.***.***.151 /dbeS/QuickSync_xml.php 200 473 "JTL-Wawi/1.11.9.0
      7 ***.***.***.117 /site.webmanifest 200 1050 "Mozilla/5.0
      6 ***.***.***.38 /_updateconsent 200 4408 "Mozilla/5.0
      6 ***.***.***.198 /admin/io 200 4423 "Mozilla/5.0
      4 ***.***.***.8 /sitemap_index.xml 500 4342 "Mozilla/5.0
      4 ***.***.***.39 /robots.txt 200 4960 "Mozilla/5.0
      4 ***.***.***.202 /site.webmanifest 200 688 "Mozilla/5.0
      4 ***.***.***.202 /site.webmanifest 200 4534 "Mozilla/5.0
      4 ***.***.***.198 /admin/io 200 4931 "Mozilla/5.0
      3 ***.***.***.37 /robots.txt 200 4960 "Mozilla/5.0
      3 ***.***.***.226 /_updateconsent 200 4349 "Mozilla/5.0
      3 ***.***.***.202 /asset/jtl3.js?v=1.4.0 200 110607 "Mozilla/5.0
      3 ***.***.***.198 /admin/io 200 1070 "Mozilla/5.0
      2 ***.***.***.72 /_updateconsent 200 4349 "Mozilla/5.0
      2 ***.***.***.70 /media/image/product/175752/sm/outcast-belly-boat-fish-cat-4-lcs-olive.jpg 404 4293 "Mozilla/5.0
      2 ***.***.***.6 /_updateconsent 200 4349 "Mozilla/5.0
      2 ***.***.***.63 /_updateconsent 200 4349 "Mozilla/5.0
      2 ***.***.***.60 /media/image/product/230015/sm/zebco-magic-cold-smoke-spiral-kaltraeucher-generator.jpg 200 8296 "Mozilla/5.0
      2 ***.***.***.52 /robots.txt 200 4938 "Mozilla/5.0
      2 ***.***.***.52 /media/image/variation/35623/md/nays-mtl-lf-65_variante-waehlen---dekor_t-05.jpg 200 30928 "Mozilla/5.0
      2 ***.***.***.41 /_updateconsent 200 4349 "Mozilla/5.0
      2 ***.***.***.40 /media/image/product/227180/sm/sportex-carat-gt-s-spin-255m-50g.webp 200 2888 "Mozilla/5.0
      2 ***.***.***.38 /robots.txt 200 4960 "Mozilla/5.0
      2 ***.***.***.37 /_updateconsent 200 562 "Mozilla/5.0
      2 ***.***.***.37 /_updateconsent 200 4349 "Mozilla/5.0
      2 ***.***.***.248 /robots.txt 500 4125 "Mozilla/5.0
      2 ***.***.***.248 /robots.txt 301 443 "Mozilla/5.0
      2 ***.***.***.216 /templates/NOVA/themes/base/fonts/montserrat/Montserrat-SemiBold.woff2 200 85548 "Mozilla/5.0
      2 ***.***.***.216 /templates/NOVA/themes/base/fontawesome/webfonts/fa-regular-400.woff2 200 13606 "Mozilla/5.0
      2 ***.***.***.216 /templates/NOVA/js/app/views/productdetails.js 200 693 "Mozilla/5.0
      2 ***.***.***.216 /templates/NOVA/js/app/views/header.js 200 2426 "Mozilla/5.0
      2 ***.***.***.216 /templates/NOVA/js/app/snippets/form-counter.js 200 1003 "Mozilla/5.0
      2 ***.***.***.216 /templates/NOVA/js/app/plugins/tabdrop.js 200 1319 "Mozilla/5.0
      2 ***.***.***.216 /templates/NOVA/js/app/plugins/navscrollbar.js 200 2201 "Mozilla/5.0
      2 ***.***.***.216 /templates/NOVA/js/app/helpers.js 200 1258 "Mozilla/5.0
      2 ***.***.***.216 /templates/NOVA/js/app/globals.js 200 491 "Mozilla/5.0
      2 ***.***.***.216 /templates/NOVA/js/app/app.js 200 521 "Mozilla/5.0
      2 ***.***.***.216 /plugins/jtl_paypal_commerce/frontend/template/ecs/jsTemplates/standaloneButtonTemplate.js 200 535 "Mozilla/5.0
      2 ***.***.***.216 /plugins/jtl_paypal_commerce/frontend/template/ecs/jsTemplates/activeButtonLabelTemplate.js 200 523 "Mozilla/5.0
      2 ***.***.***.216 /plugins/jtl_paypal_commerce/frontend/template/ecs/init.js 200 1586 "Mozilla/5.0
      2 ***.***.***.216 /plugins/jtl_paypal_commerce/frontend/js/paypal.browser.min.js 200 2131 "Mozilla/5.0
      2 ***.***.***.216 /bilder/intern/shoplogo/jtlshoplogo.png 200 38793 "Mozilla/5.0
      2 ***.***.***.214 /media/image/product/223387/md/bkk-wide-gape-hook.webp 200 18461 "Mozilla/5.0
      2 ***.***.***.210 /_updateconsent 200 4349 "Mozilla/5.0
      2 ***.***.***.205 /_updateconsent 200 547 "Mozilla/5.0
      2 ***.***.***.205 /templates/NOVA/themes/base/fonts/opensans/open-sans-600.woff2 200 15288 "Mozilla/5.0
      2 ***.***.***.205 /templates/NOVA/js/custom.js?v=1.4.0 200 520 "Mozilla/5.0
      2 ***.***.***.205 /templates/NOVA/js/app/views/productdetails.js 200 693 "Mozilla/5.0
      2 ***.***.***.205 /templates/NOVA/js/app/views/header.js 200 2426 "Mozilla/5.0
      2 ***.***.***.205 /templates/NOVA/js/app/plugins/tabdrop.js 200 1319 "Mozilla/5.0
      2 ***.***.***.205 /templates/NOVA/js/app/plugins/navscrollbar.js 200 2201 "Mozilla/5.0
      2 ***.***.***.205 /templates/NOVA/js/app/helpers.js 200 1258 "Mozilla/5.0
      2 ***.***.***.205 /templates/NOVA/js/app/globals.js 200 491 "Mozilla/5.0
      2 ***.***.***.205 /templates/NOVA/js/app/app.js 200 521 "Mozilla/5.0
      2 ***.***.***.205 /plugins/jtl_paypal_commerce/frontend/template/instalmentBanner/jsTemplates/instalmentBannerPlaceholder.js 200 526 "Mozilla/5.0
      2 ***.***.***.205 /plugins/jtl_paypal_commerce/frontend/template/ecs/jsTemplates/standaloneButtonTemplate.js 200 535 "Mozilla/5.0
      2 ***.***.***.205 /plugins/jtl_paypal_commerce/frontend/template/ecs/jsTemplates/activeButtonLabelTemplate.js 200 523 "Mozilla/5.0
      2 ***.***.***.205 /plugins/jtl_paypal_commerce/frontend/template/ecs/init.js 200 1586 "Mozilla/5.0
      2 ***.***.***.205 /plugins/jtl_paypal_commerce/frontend/js/paypal.browser.min.js 200 2131 "Mozilla/5.0
      2 ***.***.***.205 /mediafiles/Bilder/partner.png 200 17466 "Mozilla/5.0
      2 ***.***.***.205 /favicon.svg 200 42372 "Mozilla/5.0
      2 ***.***.***.205 /bilder/intern/shoplogo/jtlshoplogo.png 200 38793 "Mozilla/5.0
      2 ***.***.***.205 /asset/jtl3.js?v=1.4.0 200 110622 "Mozilla/5.0
      2 ***.***.***.202 /_updateconsent 200 4415 "Mozilla/5.0
      2 ***.***.***.202 /asset/jtl3.js?v=1.4.0 200 58543 "Mozilla/5.0
      2 ***.***.***.202 /asset/jtl3.js?v=1.4.0 200 110622 "Mozilla/5.0
      2 ***.***.***.170 /_updateconsent 200 4349 "Mozilla/5.0
      2 ***.***.***.160 /media/image/product/232166/sm/shimano-zodias-2026-spinning~2.jpg 200 3953 "Mozilla/5.0
      2 ***.***.***.14 /media/image/product/219297/sm/ba-spin-mh-search-jig-238cm-28g.jpg 200 13565 "Mozilla/5.0
      2 ***.***.***.115 /templates/NOVA/themes/base/fonts/opensans/open-sans-regular.woff2 200 18291 "Mozilla/5.0
      2 ***.***.***.115 /templates/NOVA/themes/base/fonts/opensans/open-sans-600.woff2 200 18787 "Mozilla/5.0

319 Aufrufe innerhalb von 60 Minuten. Alle ca. 18sek Aufruf.

Code:
awk '$4 >= "[21/May/2026:08:40" && $7 == "/includes/cron_inc.php" {print $1, $7, $9, $10, $12}' /var/www/clients/client3/web20/log/access.log \
| sort | uniq -c | sort -nr

    319 <eigene-IP-Adresse> /includes/cron_inc.php 200 4353 "jtl-shop-cron"
Sind zwar nur n bissel mehr als 4KB... aber 1,4MB unnötigerweise je Stunde bewegt.

Hintergrund der Sucherei ist ein langerser Shop bzw. gut ausgelasteter Server.

Code:
ps -o pid,ppid,user,etime,%cpu,%mem,cmd -u web20

4115051 web20 44.0% php-fpm: pool web20
4115052 web20 47.1% php-fpm: pool web20
4115053 web20 43.1% php-fpm: pool web20
4115054 web20 47.0% php-fpm: pool web20
4115055 web20 45.4% php-fpm: pool web20
4115056 web20 39.7% php-fpm: pool web20

Frage: Könnt Ihr das nachstellen? Bzw. Wieso geht JTL diesen dummen Weg?
Klar... es ist der schnellste/einfachste Weg um was abzuarbeiten und der Kundenfreundlichste.
Der Admin/Kunde braucht nicht mehr per Crontab -e irgendwas eintragen... und Fehler machen.
ABER: der aktuelle Weg scheint bei jeder Website Aufruf ausgeleiferrt zu werden.

WENN meine Vermutung so stimmt, dann wäre doch:
* Schreibe ein cron.ini oder cron.log/cron.txt wo eine Uhrzeit eingetragen wird.
* Bot/Besucher/Seitenreload ruft weiterhin die cron ab => cron prüft, ob 60sekunden vergangen sind:
* sind nicht = abbruch
* sind erreicht = weiterer Scriptlauf mit DB Abfragen und am ende = neuer Timestamp setzen

Würde ich jetzt so gerne umsetzen wollen... frage mich aber, was ich da noch evtl. alles abschießen würde.
Oder gibt es andere Lösungen ?

Danke
 

css-umsetzung

Offizieller Service Partner
SPBanner
6. Juli 2011
8.648
2.700
Berlin
Firma
css-umsetzung
Warum deaktivierst du das nicht einfach im Shop und verwendest einen vernünftigen cron, der je nachdem jede Minute oder einmal die Stunde schaut ob es etwas zu tun gibt.
ich lasse den grundsätzlich jede Minute starten.
 
  • Gefällt mir
Reaktionen: lord_icon

NoOne

Sehr aktives Mitglied
16. März 2024
673
230
Nein, das passiert nicht bei jedem Aufruf, es sei denn man setzt den Pseudo-Cron (bzw. die Einstellung "Server-to-Server jeden X-ten Aufruf starten") auf 1. Und das ist vermutlich so implementiert, weil nicht jedes Hosting Cronjobs anbietet.
 

JohnFrea

Sehr aktives Mitglied
21. September 2017
975
305
Was ist denn die Alternative, wenn der Server (z.B. All-Inkl) Cron Jobs bietet?
Ich finde gar keine Doku, welche URL der externe Cronjob für den Shop aufzurufen hat...
 

deliman

Sehr aktives Mitglied
13. Februar 2016
1.069
132
Würde ich auch gern wissen, da schon mal nach der passenden URL für einen Cron auf dem Server gesucht. Irgendwo im Forum war der spezielle angegeben aber wenn man sich den passenden Thread nicht gleich speichert... Dazu findet man auch im JTL Wiki nur etwas zu den Shopinternen Crons, nicht aber wenn man die alternativ auf dem Server selber nachbilden will.
 

JohnFrea

Sehr aktives Mitglied
21. September 2017
975
305
@NoOne vielen Dank.
Aber ich verstehe nicht, wie das am besten umzusetzen ist.
In welchem Intervall sollte man die URL durch einen Cronjob aufrufen?
Die Infos auf der Seite scheinen sich zu widerprechen...
 

Ähnliche Themen