# Failed to execute Action "Script": Unable to complete execution because CPU limit of 1000 ms exceeded

**URL:** <https://community.fibery.io/t/failed-to-execute-action-script-unable-to-complete-execution-because-cpu-limit-of-1000-ms-exceeded/4747>\
**Category:** API & Programming\
**Created:** [July 7, 2023, 8:56am UTC](https://community.fibery.io/t/failed-to-execute-action-script-unable-to-complete-execution-because-cpu-limit-of-1000-ms-exceeded/4747 "2023-07-07T08:56:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ooker](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/ooker/32/7033_2.png) [@Ooker](https://community.fibery.io/u/Ooker)\
**Post date:** [July 7, 2023, 8:56am UTC](https://community.fibery.io/t/failed-to-execute-action-script-unable-to-complete-execution-because-cpu-limit-of-1000-ms-exceeded/4747/1 "2023-07-07T08:56:51Z")

</div>

I run a script and I get:

> Failed to execute Action “Script”: Unable to complete execution because CPU limit of 1000 ms exceeded

Is there a way to get more runtime? Here is the script:  
[https://github.com/QuaCau-TheSphere/script-le/blob/main/Quản%20lý%20tài%20chính%20bằng%20tiếng%20Việt%20tự%20nhiên%20trên%20Fibery.js](https://github.com/QuaCau-TheSphere/script-le/blob/main/Qu%E1%BA%A3n%20l%C3%BD%20t%C3%A0i%20ch%C3%ADnh%20b%E1%BA%B1ng%20ti%E1%BA%BFng%20Vi%E1%BB%87t%20t%E1%BB%B1%20nhi%C3%AAn%20tr%C3%AAn%20Fibery.js)

I figure out that it’s because I have a regex test for strings containing unicode characters. In particular [`/đ\b/` doesn’t match `đ`](https://stackoverflow.com/q/76627655/3416774). To solve this I replace `/đ\b/` with `/đ(?=$|\P{L})/u`. But this runs very slow. At the end of the day I use this workaround:

```js
input = input + ' '
var regex = new RegExp(word + ' ', 'gi');
const test = regex.test(input)

```

However I’m still interested to know the answer of the question in the title.

---

<div class="post-metadata">

**Author:** ![Sergey\_Truhtanov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/sergey_truhtanov/32/13986_2.png) [@Sergey\_Truhtanov](https://community.fibery.io/u/Sergey_Truhtanov)\
**Post date:** [July 17, 2023, 11:52am UTC](https://community.fibery.io/t/failed-to-execute-action-script-unable-to-complete-execution-because-cpu-limit-of-1000-ms-exceeded/4747/2 "2023-07-17T11:52:41Z")

</div>

Hello.  
I get 404 from the link above, so I cannot check your script ☹

We have some cpu+time limits on user scripts. CPU limits are calculated by getting metrics from process stat file for sandboxed subprocess, that is created for your script execution.  
We have those limits in for order user script not be able to consume too much of resources.  
General advice is to try optimize your script to consume less resources.  
We may change limits if some basic tasks won’t be able to complete, but at the moment it is not the case.

---

<div class="post-metadata">

**Author:** ![Ooker](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/ooker/32/7033_2.png) [@Ooker](https://community.fibery.io/u/Ooker)\
**Post date:** [July 17, 2023, 2:33pm UTC](https://community.fibery.io/t/failed-to-execute-action-script-unable-to-complete-execution-because-cpu-limit-of-1000-ms-exceeded/4747/3 "2023-07-17T14:33:19Z")

</div>

Here is the correct file: [https://github.com/QuaCau-TheSphere/CA-quan-ly-tai-chinh-bang-tieng-Viet-tu-nhien/blob/4f947d5a583a0f464fb576be78fe87601f59e6de/Quản%20lý%20tài%20chính%20bằng%20tiếng%20Việt%20tự%20nhiên%20trên%20Fibery.js](https://github.com/QuaCau-TheSphere/CA-quan-ly-tai-chinh-bang-tieng-Viet-tu-nhien/blob/4f947d5a583a0f464fb576be78fe87601f59e6de/Qu%E1%BA%A3n%20l%C3%BD%20t%C3%A0i%20ch%C3%ADnh%20b%E1%BA%B1ng%20ti%E1%BA%BFng%20Vi%E1%BB%87t%20t%E1%BB%B1%20nhi%C3%AAn%20tr%C3%AAn%20Fibery.js)

I understand the concern of limited resource, but why not extend it in the paid plan?
