Hi Ammad,

This table is the intermediate table to calculate the network usage. You
can remove some very old records.
You can get the actual time by event_time_millis, for example

select FROM_UNIXTIME(event_time_millis/1000) from cloud_usage.usage_network
limit 1;


-Wei



On Wed, Dec 18, 2024 at 11:48 AM Ammad Syed <syedamma...@gmail.com> wrote:

> Hi,
>
> I am using cloudstack 4.11.3. Our cloudstack usage database has grown alot.
> So I have used removeRawUsageRecords api to remove records older then 45
> days and optimized cloud_usage table and gained space.
>
> I have noticed that table network_usage has also grown lot and its size is
> very large. Anyone advise how to delete old usage data from network_usage
> table ?
>
> Because I don't see any timestamp to remove older records like we have in
> cloud_usage table.
>
>         account_id: 1
>            zone_id: 1
>            host_id: 10435
>          host_type: DomainRouter
>         network_id: 1663
>         bytes_sent: 0
>     bytes_received: 0
>  event_time_millis: 1472630399999
> agg_bytes_received: 0
>     agg_bytes_sent:
>
> I see event_time_millis and its epoch time. Is it safe to delete old
> records based on this time stamp ?
>
> --
> Ammad
>

Reply via email to