Fist Gb at 10Mbit, then limited to 512Kbps

Hello.
I have OS 5.25.
I have set up till now all simple queues to limit the customer’s IP addresses to their internet profile (ex. 2M/256Kbps).

I would like to set up this rule:

The first Gb of the day is set to 10M/1M Mbit bandwidth, then after 1Gb of consumed traffic, the line is set to 512Kbps/256Kbps

How is acheivable all of this?

I identify the customers with a static IP address. The RB is in router mode.

I have found this example:
http://wiki.mikrotik.com/wiki/Limiting_a_user_to_a_given_amount_of_traffic_II

But can I set it for 150 users? I have now about 150 queues on a single router.

i think ROS is not able to do this out of the box. a radius server with accounting could help. or write a quick and dirty script which runs on your router every 5 minutes an check the counters and then set the limit

Can you provide some hints?

I have a list of queues:
from queue #5 to #100 (for example)
each queue is as this:

add interface=eth2-master-Torre7 max-limit=256k/4M name=Fogli queue=pcq-upload/pcq-download target-addresses=172.16.7.15/32 total-queue=default
add interface=eth2-master-Torre7 max-limit=256k/1280k name=Marzullo queue=pcq-upload/pcq-download target-addresses=172.16.7.17/32 total-queue=default
add interface=eth2-master-Torre7 max-limit=256k/1280k name=Corvino queue=pcq-upload/pcq-download target-addresses=172.16.7.19/32 total-queue=default
add interface=eth2-master-Torre7 max-limit=256k/1280k name=Pochet queue=pcq-upload/pcq-download target-addresses=172.16.7.20/32 total-queue=default

I’m new to RouterOS, but here is logic that I’m using to identify connections. You could adjust it for IP or interface and have it work just as well I would think. Change prerouting to forward I think if you’re masquerading. Once you have marked the connection, use Queue Tree (not simple) to rate limit them.

/ip firewall mangle

Logic is as follows

Mark all new connections with “M1” if they have not previously been marked as “M1_BIG”.

IF the current mark of “M1” tranfers more than 5MB AND at a rate of 200k+ THEN mark it as “M1_BIG” for the duration of the session.

add chain=prerouting action=mark-connection protocol=tcp connection-mark=!“M1_BIG” new-connection-mark=“M1” connection-state=new
add chain=prerouting action=mark-connection protocol=tcp connection-mark=“M1” new-connection-mark=“M1_BIG” connection-bytes=500000-0 connection-rate=200k-100M
add chain=prerouting action=mark-packet passthrough=no connection-mark=“M1_BIG” new-packet-mark=“M1_BIG”
add chain=prerouting action=mark-packet passthrough=no connection-mark=“M1” new-packet-mark=“M1”

http://forum.mikrotik.com/t/how-to-limit-a-user-to-a-given-amount-of-traffic/237/1

I have seen an example of service A, B, C but I am not able to reproduce it.
I have seen in the first post of the second thread’s page
can someone help me?
even on a consulting form?