• Resolved psablik

    (@psablik)


    Hi,

    I recently encountered an issue where my website started running very slowly, and some functionalities stopped working. After debugging, I discovered that the database was full. Upon further investigation, I found that the wp_woocommerce_sessions table contained approximately 75,000 rows, out of which 69,000 were expired, taking up around 4.2 GB of space.

    From what I’ve read online, WooCommerce is supposed to clear this table automatically, but that doesn’t seem to be happening. Could you help me resolve this issue to ensure the table is properly maintained and prevent my site from breaking due to database overload? I’ll post below WooCommerce system raport from my site.

    Thanks in advance for your support!

    Best regards,

    WordPress Environment

    WordPress address (URL): XXX
    Site address (URL): XXX
    WC Version: 9.4.3
    Legacy REST API Package Version: Wtyczka przestarzałego REST API nie jest zainstalowana w tej witrynie.
    Action Scheduler Version: ✔ 3.8.2
    Log Directory Writable: ✔
    WP Version: 6.7.2
    WP Multisite: –
    WP Memory Limit: 512 MB
    WP Debug Mode: –
    WP Cron: ✔
    Language: pl_PL
    External object cache: – Server Environment

    Server Info: Apache/2
    PHP Version: 7.4.33
    PHP Post Max Size: 512 MB
    PHP Time Limit: 600
    PHP Max Input Vars: 1000
    cURL Version: 7.68.0
    OpenSSL/1.1.1f

    SUHOSIN Installed: –
    MySQL Version: 5.5.5-10.5.27-MariaDB-log
    Max Upload Size: 512 MB
    Default Timezone is UTC: ✔
    fsockopen/cURL: ✔
    SoapClient: ✔
    DOMDocument: ✔
    GZip: ✔
    Multibyte String: ✔
    Remote Post: ✔
    Remote Get: ✔ Database

    WC Database Version: 9.4.3
    WC Database Prefix: wp_
    Całkowity rozmiar bazy danych: 996,00MB
    Rozmiar bazy danych: 965,00MB
    Rozmiar indeksu bazy danych: 31,00MB
    wp_woocommerce_sessions: Dane: 678,02MB + Indeks: 3,13MB + Silnik InnoDB
    wp_woocommerce_api_keys: Dane: 0,02MB + Indeks: 0,03MB + Silnik InnoDB
    wp_woocommerce_attribute_taxonomies: Dane: 0,02MB + Indeks: 0,02MB + Silnik InnoDB
    wp_woocommerce_downloadable_product_permissions: Dane: 0,02MB + Indeks: 0,06MB + Silnik InnoDB
    wp_woocommerce_order_items: Dane: 1,52MB + Indeks: 0,19MB + Silnik InnoDB
    wp_woocommerce_order_itemmeta: Dane: 5,52MB + Indeks: 5,03MB + Silnik InnoDB
    wp_woocommerce_tax_rates: Dane: 0,02MB + Indeks: 0,06MB + Silnik InnoDB
    wp_woocommerce_tax_rate_locations: Dane: 0,02MB + Indeks: 0,03MB + Silnik InnoDB
    wp_woocommerce_shipping_zones: Dane: 0,02MB + Indeks: 0,00MB + Silnik InnoDB
    wp_woocommerce_shipping_zone_locations: Dane: 0,02MB + Indeks: 0,05MB + Silnik InnoDB
    wp_woocommerce_shipping_zone_methods: Dane: 0,02MB + Indeks: 0,00MB + Silnik InnoDB
    wp_woocommerce_payment_tokens: Dane: 0,02MB + Indeks: 0,02MB + Silnik InnoDB
    wp_woocommerce_payment_tokenmeta: Dane: 0,02MB + Indeks: 0,03MB + Silnik InnoDB
    wp_woocommerce_log: Dane: 0,02MB + Indeks: 0,02MB + Silnik InnoDB
    wp_actionscheduler_actions: Dane: 0,27MB + Indeks: 0,33MB + Silnik InnoDB
    wp_actionscheduler_claims: Dane: 0,02MB + Indeks: 0,02MB + Silnik InnoDB
    wp_actionscheduler_groups: Dane: 0,02MB + Indeks: 0,02MB + Silnik InnoDB
    wp_actionscheduler_logs: Dane: 0,22MB + Indeks: 0,14MB + Silnik InnoDB
    wp_aws_cache: Dane: 0,02MB + Indeks: 0,00MB + Silnik InnoDB
    wp_aws_index: Dane: 1,52MB + Indeks: 0,70MB + Silnik InnoDB
    wp_cartflows_ca_cart_abandonment: Dane: 3,52MB + Indeks: 0,06MB + Silnik InnoDB
    wp_cartflows_ca_email_history: Dane: 0,02MB + Indeks: 0,03MB + Silnik InnoDB
    wp_cartflows_ca_email_templates: Dane: 0,02MB + Indeks: 0,00MB + Silnik InnoDB
    wp_cartflows_ca_email_templates_meta: Dane: 0,02MB + Indeks: 0,02MB + Silnik InnoDB
    wp_commentmeta: Dane: 0,02MB + Indeks: 0,03MB + Silnik InnoDB
    wp_comments: Dane: 2,52MB + Indeks: 1,25MB + Silnik InnoDB
    wp_e_events: Dane: 0,02MB + Indeks: 0,02MB + Silnik InnoDB
    wp_jetpack_sync_queue: Dane: 0,02MB + Indeks: 0,06MB + Silnik InnoDB
    wp_links: Dane: 0,02MB + Indeks: 0,02MB + Silnik InnoDB
    wp_litespeed_crawler: Dane: 0,02MB + Indeks: 0,03MB + Silnik InnoDB
    wp_litespeed_crawler_blacklist: Dane: 0,02MB + Indeks: 0,03MB + Silnik InnoDB
    wp_litespeed_url: Dane: 0,02MB + Indeks: 0,03MB + Silnik InnoDB
    wp_litespeed_url_file: Dane: 0,02MB + Indeks: 0,08MB + Silnik InnoDB
    wp_options: Dane: 8,50MB + Indeks: 0,31MB + Silnik InnoDB
    wp_postmeta: Dane: 46,56MB + Indeks: 9,03MB + Silnik InnoDB
    wp_posts: Dane: 109,52MB + Indeks: 0,70MB + Silnik InnoDB
    wp_seraph_accel_queue: Dane: 0,02MB + Indeks: 0,06MB + Silnik InnoDB
    wp_termmeta: Dane: 0,05MB + Indeks: 0,03MB + Silnik InnoDB
    wp_terms: Dane: 0,02MB + Indeks: 0,03MB + Silnik InnoDB
    wp_term_relationships: Dane: 0,16MB + Indeks: 0,09MB + Silnik InnoDB
    wp_term_taxonomy: Dane: 0,02MB + Indeks: 0,03MB + Silnik InnoDB
    wp_trp_dictionary_pl_pl_en_gb: Dane: 2,52MB + Indeks: 2,42MB + Silnik InnoDB
    wp_trp_gettext_en_gb: Dane: 1,52MB + Indeks: 0,69MB + Silnik InnoDB
    wp_trp_gettext_original_meta: Dane: 0,02MB + Indeks: 0,05MB + Silnik InnoDB
    wp_trp_gettext_original_strings: Dane: 0,28MB + Indeks: 0,16MB + Silnik InnoDB
    wp_trp_gettext_pl_pl: Dane: 1,52MB + Indeks: 0,77MB + Silnik InnoDB
    wp_trp_original_meta: Dane: 0,23MB + Indeks: 0,33MB + Silnik InnoDB
    wp_trp_original_strings: Dane: 2,52MB + Indeks: 1,52MB + Silnik InnoDB
    wp_usermeta: Dane: 1,52MB + Indeks: 0,56MB + Silnik InnoDB
    wp_users: Dane: 0,08MB + Indeks: 0,05MB + Silnik InnoDB
    wp_wcpdf_invoice_number: Dane: 0,02MB + Indeks: 0,00MB + Silnik InnoDB
    wp_wc_admin_notes: Dane: 0,13MB + Indeks: 0,00MB + Silnik InnoDB
    wp_wc_admin_note_actions: Dane: 0,09MB + Indeks: 0,02MB + Silnik InnoDB
    wp_wc_category_lookup: Dane: 0,02MB + Indeks: 0,00MB + Silnik InnoDB
    wp_wc_customer_lookup: Dane: 0,11MB + Indeks: 0,08MB + Silnik InnoDB
    wp_wc_download_log: Dane: 0,02MB + Indeks: 0,03MB + Silnik InnoDB
    wp_wc_orders: Dane: 0,02MB + Indeks: 0,11MB + Silnik InnoDB
    wp_wc_orders_meta: Dane: 0,02MB + Indeks: 0,03MB + Silnik InnoDB
    wp_wc_order_addresses: Dane: 0,02MB + Indeks: 0,06MB + Silnik InnoDB
    wp_wc_order_coupon_lookup: Dane: 0,02MB + Indeks: 0,03MB + Silnik InnoDB
    wp_wc_order_operational_data: Dane: 0,02MB + Indeks: 0,03MB + Silnik InnoDB
    wp_wc_order_product_lookup: Dane: 1,52MB + Indeks: 0,56MB + Silnik InnoDB
    wp_wc_order_stats: Dane: 0,20MB + Indeks: 0,17MB + Silnik InnoDB
    wp_wc_order_tax_lookup: Dane: 0,02MB + Indeks: 0,03MB + Silnik InnoDB
    wp_wc_product_attributes_lookup: Dane: 0,06MB + Indeks: 0,05MB + Silnik InnoDB
    wp_wc_product_download_directories: Dane: 0,02MB + Indeks: 0,02MB + Silnik InnoDB
    wp_wc_product_meta_lookup: Dane: 0,25MB + Indeks: 0,48MB + Silnik InnoDB
    wp_wc_rate_limits: Dane: 0,02MB + Indeks: 0,02MB + Silnik InnoDB
    wp_wc_reserved_stock: Dane: 0,02MB + Indeks: 0,00MB + Silnik InnoDB
    wp_wc_tax_rate_classes: Dane: 0,02MB + Indeks: 0,02MB + Silnik InnoDB
    wp_wc_webhooks: Dane: 0,02MB + Indeks: 0,02MB + Silnik InnoDB
    wp_woobe_history: Dane: 0,02MB + Indeks: 0,05MB + Silnik InnoDB
    wp_woobe_history_bulk: Dane: 0,02MB + Indeks: 0,03MB + Silnik InnoDB
    wp_woocommerce_p24_data: Dane: 0,02MB + Indeks: 0,03MB + Silnik InnoDB
    wp_woocommerce_p24_order_map: Dane: 0,02MB + Indeks: 0,03MB + Silnik InnoDB
    wp_woocommerce_p24_subscription: Dane: 0,02MB + Indeks: 0,06MB + Silnik InnoDB
    wp_wpforms_logs: Dane: 0,02MB + Indeks: 0,00MB + Silnik InnoDB
    wp_wpforms_payments: Dane: 0,02MB + Indeks: 0,14MB + Silnik InnoDB
    wp_wpforms_payment_meta: Dane: 0,02MB + Indeks: 0,05MB + Silnik InnoDB
    wp_wpforms_tasks_meta: Dane: 0,02MB + Indeks: 0,00MB + Silnik InnoDB
    wp_wpml_mails: Dane: 91,52MB + Indeks: 0,00MB + Silnik InnoDB
    wp_wpvivid_options: Dane: 0,02MB + Indeks: 0,02MB + Silnik InnoDB
    wp_wpvivid_scan_result: Dane: 0,02MB + Indeks: 0,00MB + Silnik InnoDB
    wp_wpvivid_unused_uploads_files: Dane: 0,02MB + Indeks: 0,00MB + Silnik InnoDB
    wp_yoast_indexable: Dane: 1,52MB + Indeks: 0,31MB + Silnik InnoDB
    wp_yoast_indexable_hierarchy: Dane: 0,06MB + Indeks: 0,08MB + Silnik InnoDB
    wp_yoast_migrations: Dane: 0,02MB + Indeks: 0,02MB + Silnik InnoDB
    wp_yoast_primary_term: Dane: 0,06MB + Indeks: 0,06MB + Silnik InnoDB
    wp_yoast_seo_links: Dane: 0,27MB + Indeks: 0,17MB + Silnik InnoDB Post Type Counts

    attachment: 956
    custom_css: 5
    elementor_library: 16
    language_switcher: 4
    nav_menu_item: 24
    page: 27
    popup: 3
    popup_theme: 9
    post: 1
    product: 852
    product_variation: 289
    revision: 1448
    shop_coupon: 9
    shop_order: 1594
    woolentor-template: 1
    wpforms: 1 Security

    Secure connection (HTTPS): ✔
    Hide errors from visitors: ✔ Active Plugins (31)

    Advanced Woo Search: przez ILLID – 3.25
    Apaczka.pl WooCommerce: przez Inspire Labs – 1.4.8
    Szablony startowe: przez Brainstorm Force – 4.4.11
    CartFlows: przez CartFlows Inc – 2.1.7
    Cookie Notice & Compliance dla RODO / CCPA: przez Hu-manity.co – 2.5.5
    Elementor: przez Elementor.com – 3.27.2
    Flexible Shipping: przez Octolize – 5.1.3
    Jetpack: przez Automattic – 14.2.1
    LiteSpeed Cache: przez LiteSpeed Technologies – 6.5.4
    Menu Icons: przez ThemeIsle – 0.13.16
    Popup Maker: przez Popup Maker – 1.20.3
    Product Variations Swatches for WooCommerce: przez VillaTheme – 1.1.7
    Shortcode in Menus: przez Gagan Deep Singh – 3.5.1
    TranslatePress - Multilingual: przez Cozmoslabs
    Razvan Mocanu
    Madalin Ungureanu
    Cristophor Hurduban – 2.9.3

    W Budowie: przez WebFactory Ltd – 4.01
    UpdraftPlus - Kopia/przywracanie: przez TeamUpdraft
    DavidAnderson – 1.25.1

    Converter for Media: przez matt plugins – 6.2.0
    BEAR – Bulk Editor and Products Manager Professional for WooCommerce: przez realmag777 – 1.1.4.5
    WooCommerce Cart Abandonment Recovery: przez CartFlows Inc – 1.3.1
    InPost dla WooCommerce: przez Inspire Labs – 1.4.0
    Advanced Order Export For WooCommerce: przez AlgolPlus – 3.5.7
    WooCommerce Checkout Manager: przez QuadLayers – 7.6.4
    Country Based Payments for WooCommerce: przez Ivan Paulin – 1.5
    WooCommerce Stripe Gateway: przez Stripe – 9.1.1
    CURCY - WooCommerce Multi Currency Premium: przez VillaTheme – 2.1.32
    WooCommerce PayPal Payments: przez WooCommerce – 2.9.6
    WooCommerce: przez Automattic – 9.4.3 (dostępna aktualizacja do wersji 9.6.2)
    ShopLentor – WooCommerce Builder for Elementor & Gutenberg: przez HasThemes – 3.0.3
    Yoast SEO: przez Zespół Yoast – 24.3
    WPForms Lite: przez WPForms – 1.9.3.2
    WPFront Scroll Top: przez WPFront Team – 2.2 Inactive Plugins (4)

    Apaczka.pl: przez iLabs LTD – 1.2.9
    Import / Export Customizer Settings: przez Brainstorm Force – 1.1.0
    WooCommerce Conotoxia Pay Gateway: przez Conotoxia Sp. z o.o. – 1.11.1
    WooCommerce Przelewy24 Payment Gateway: przez Przelewy24 Sp. z o.o. – 1.0.27 Dropin Plugins ()

    advanced-cache.php: advanced-cache.php Settings

    Legacy API Enabled: –
    Force SSL: –
    Currency: EUR (€)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: ,
    Number of Decimals: 2
    Taxonomies: Product Types: external (external)
    grouped (grouped)
    simple (simple)
    variable (variable)

    Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
    exclude-from-search (exclude-from-search)
    featured (featured)
    outofstock (outofstock)
    rated-1 (rated-1)
    rated-2 (rated-2)
    rated-3 (rated-3)
    rated-4 (rated-4)
    rated-5 (rated-5)

    Connected to WooCommerce.com: –
    Enforce Approved Product Download Directories: –
    HPOS feature enabled: –
    Order datastore: WC_Order_Data_Store_CPT
    HPOS data sync enabled: – Logging

    Enabled: ✔
    Handler: Automattic\WooCommerce\Internal\Admin\Logging\LogHandlerFileV2
    Retention period: 30 dni
    Level threshold: –
    Log directory size: 43 MB WC Pages

    Strona sklepu: #401 - /shop/
    Koszyk: #97 - /cart/ - Zawiera krótki kod (shortcode) [woocommerce_cart]
    Zamówienie: #98 - /checkout/ - Zawiera krótki kod (shortcode) [woocommerce_checkout]
    Moje konto: #99 - /my-account/
    Regulamin: #3515 - /terms-conditions/ Theme

    Name: Astra
    Version: 3.6.5 (dostępna aktualizacja do wersji 4.8.12)
    Author URL: https://wpastra.com/about/
    Child Theme: ❌ – Jeśli modyfikujesz WooCommerce lub motyw nadrzędny
    którego nie jesteś autorem
    polecamy używanie motywu potomnego. Zobacz: Jak tworzyć motywy potomne

    WooCommerce Support: ✔ Templates

    Overrides: – WooCommerce PayPal Payments

    Onboarded: ✔
    Shop country code: PL
    WooCommerce currency supported: ✔
    Advanced Card Processing available in country: ✔
    Pay Later messaging available in country: –
    Webhook status: –
    PayPal Vault enabled: –
    ACDC Vault enabled: –
    Logging enabled: –
    Reference Transactions: –
    Used PayPal Checkout plugin: ✔
    Subscriptions Mode: Disabled
    PayPal Shipping Callback: –
    Apple Pay: –
    Google Pay: –
    Fastlane: – Admin

    Enabled Features: activity-panels
    analytics
    product-block-editor
    coupons
    core-profiler
    customize-store
    customer-effort-score-tracks
    import-products-task
    experimental-fashion-sample-products
    shipping-smart-defaults
    shipping-setting-tour
    homescreen
    marketing
    mobile-app-banner
    navigation
    onboarding
    onboarding-tasks
    pattern-toolkit-full-composability
    product-custom-fields
    remote-inbox-notifications
    remote-free-extensions
    payment-gateway-suggestions
    printful
    shipping-label-banner
    subscriptions
    store-alerts
    transient-notices
    woo-mobile-welcome
    wc-pay-promotion
    wc-pay-welcome-page
    launch-your-store

    Disabled Features: product-data-views
    experimental-blocks
    minified-js
    product-pre-publish-modal
    settings
    async-product-editor-category-field
    product-editor-template-system
    blueprint
    reactify-classic-payments-settings
    use-wp-horizon

    Daily Cron: ✔ Next scheduled: 2025-02-16 00:07:16 +01:00
    Options: ✔
    Notes: 224
    Onboarding: completed Action Scheduler

    Zakończ: 664
    Oldest: 2025-01-15 13:14:54 +0100
    Newest: 2025-02-15 12:14:47 +0100

    Niepowodzenie: 74
    Oldest: 2023-02-26 22:54:16 +0100
    Newest: 2025-02-02 23:52:03 +0100

    Oczekujące: 8
    Oldest: 2025-02-16 12:13:34 +0100
    Newest: 2025-02-22 12:13:34 +0100 Status report information

    Generated at: 2025-02-15 12:28:15 +01:00
    `
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @psablik,

    Thank you for providing the details. To help resolve the issue, I recommend checking the scheduled actions on your site. WooCommerce uses these actions to handle background tasks, such as cleaning up expired sessions. You can view the scheduled actions by installing and activating the Action Scheduler plugin. Once activated, go to WooCommerce > Status > Scheduled Actions to check if any actions related to session cleanup are stuck or pending. If you find any, try manually triggering them and see if that clears the expired sessions. Additionally, it would be helpful to check for any failed actions or errors that may have occurred.

    Another step is to look for any fatal errors that could be affecting the cron jobs. Please paste it(if any) via https://gist.github.com/ and send the link here.

    Thank you.

    Thread Starter psablik

    (@psablik)

    Hi @mahfuzurwp,

    I’ve installed Action Scheduler plugin, looking into ‘Scheduled actions’ I can see:
    All (746) | Complete (664) | Failed (74) | Pending (8)

    Could you tell me for which hook I should be looking for?

    Thanks

    Hi @psablik,

    Check for any failed scheduled actions related to WooCommerce sessions and manually trigger them.

    For scheduled actions, look for woocommerce_cleanup_sessions or wc_session_cleanup and trigger them manually.

    Alternatively, you can clear the table by going to WooCommerce > Status > Tools and clicking the “Clear customer sessions” button.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘WooCommerce not clearing old sessions’ is closed to new replies.